diff -N -c -r -X exclude_files squid-1.0.beta8/src/icp.c squid-1.0.beta8.henrik/src/icp.c *** squid-1.0.beta8/src/icp.c Mon May 20 18:21:21 1996 --- squid-1.0.beta8.henrik/src/icp.c Tue May 21 00:05:39 1996 *************** *** 1713,1719 **** { static char buf[256]; int n; ! StoreEntry *entry = NULL; n = read(fd, buf, 256); if (n > 0) { debug(12, 0, "icpDetectClientClose: FD %d, %d unexpected bytes\n", --- 1713,1719 ---- { static char buf[256]; int n; ! StoreEntry *entry = icpState->entry; n = read(fd, buf, 256); if (n > 0) { debug(12, 0, "icpDetectClientClose: FD %d, %d unexpected bytes\n", *************** *** 1724,1741 **** (void *) icpState); return; } ! debug(12, 1, "icpDetectClientClose: FD %d\n", fd); ! debug(12, 1, "--> URL '%s'\n", icpState->url); ! if (n < 0) ! debug(12, 1, "--> ERROR %s\n", xstrerror()); ! CheckQuickAbort(icpState); ! entry = icpState->entry; ! if (entry && icpState->url) ! protoUndispatch(fd, icpState->url, entry, icpState->request); ! icpFreeBufOrPage(icpState); ! comm_close(fd); ! if (entry) { storeUnregister(entry, fd); ! storeUnlockObject(entry); } } --- 1724,1752 ---- (void *) icpState); return; } ! if (n==0 && entry!=NULL && icpState->offset == entry->object_len && ! entry->store_status != STORE_PENDING) { ! /* We're finished case */ ! debug(12, 7, "icpDetectClientClose: FD %d end of transmission\n", fd); ! CacheInfo->proto_touchobject(CacheInfo, ! CacheInfo->proto_id(entry->url), ! icpState->offset); ! comm_close(fd); storeUnregister(entry, fd); ! storeUnlockObject(entry); /* unlock after comm_close().. */ ! } else { ! debug(12, 1, "icpDetectClientClose: FD %d\n", fd); ! debug(12, 1, "--> URL '%s'\n", icpState->url); ! if (n < 0) ! debug(12, 1, "--> ERROR %s\n", xstrerror()); ! CheckQuickAbort(icpState); ! if (entry && icpState->url) ! protoUndispatch(fd, icpState->url, entry, icpState->request); ! icpFreeBufOrPage(icpState); ! comm_close(fd); ! if (entry) { ! storeUnregister(entry, fd); ! storeUnlockObject(entry); ! } } }