diff -N -c -r -X exclude_files squid-1.0.beta9/src/icp.c squid-1.0.beta9.henrik/src/icp.c *** squid-1.0.beta9/src/icp.c Mon May 27 16:58:50 1996 --- squid-1.0.beta9.henrik/src/icp.c Fri May 24 09:17:21 1996 *************** *** 166,171 **** --- 166,172 ---- storeUnlockObject(icpState->entry); icpState->entry=NULL; } + icpFreeBufOrPage(icpState); safe_free(icpState); return 0; /* XXX gack, all comm handlers return ints */ } *************** *** 434,446 **** int errflag; icpStateData *icpState; { - StoreEntry *entry = NULL; debug(12, 4, "icpSendERRORComplete: FD %d: sz %d: err %d.\n", fd, size, errflag); /* Clean up client side statemachine */ - entry = icpState->entry; - icpFreeBufOrPage(icpState); comm_close(fd); } --- 435,444 ---- *************** *** 1743,1767 **** debug(12, 2, "asciiConnLifetimeHandle: Socket: %d lifetime is expired. Free up data structure.\n", fd); ! /* If a write handler was installed, we were in the middle of an ! * icpWrite and we're going to need to deallocate the icpReadWrite ! * buffer. These come from icpSendMoreData and from icpSendERROR, both ! * of which allocate 4k buffers. */ ! handler = NULL; client_data = NULL; comm_get_select_handler(fd, COMM_SELECT_WRITE, &handler, (void **) &client_data); ! if ((handler != NULL) && (client_data != NULL)) { icpRWState = (icpRWStateData *) client_data; - if (icpRWState->buf) - put_free_4k_page(icpRWState->buf); safe_free(icpRWState); } ! /* If we have a read handler, we were reading in the get/post URL ! * and don't have to deallocate the icpreadWrite buffer */ handler = NULL; client_data = NULL; comm_get_select_handler(fd, --- 1741,1760 ---- debug(12, 2, "asciiConnLifetimeHandle: Socket: %d lifetime is expired. Free up data structure.\n", fd); ! /* If we were in the middle of an icpWrite we're going to need ! * to deallocate the icpReadWrite state data. */ handler = NULL; client_data = NULL; comm_get_select_handler(fd, COMM_SELECT_WRITE, &handler, (void **) &client_data); ! if (handler == (PF) icpHandleWrite && client_data != NULL) { icpRWState = (icpRWStateData *) client_data; safe_free(icpRWState); } ! /* If we were in the middle of an icpRead we're going to need ! * to deallocate the icpReadWrite state data. */ handler = NULL; client_data = NULL; comm_get_select_handler(fd, *************** *** 1912,1918 **** CheckQuickAbort(icpState); if (entry && icpState->url) protoUndispatch(fd, icpState->url, entry, icpState->request); - icpFreeBufOrPage(icpState); comm_close(fd); } } --- 1905,1910 ----