Wed Nov 24 22:19:16 CET 1999 Modified Files in squid/src client_side.c Squid unintentionally denied persistent connections on IMS-HIT replies. Index: squid/src/client_side.c diff -u squid/src/client_side.c:1.1.1.45.2.10 squid/src/client_side.c:1.1.1.45.2.12 --- squid/src/client_side.c:1.1.1.45.2.10 Sun Nov 7 14:53:58 1999 +++ squid/src/client_side.c Wed Nov 24 22:19:14 1999 @@ -1147,11 +1147,13 @@ getMyHostname(), Config.Port.http->port); #endif /* - * Clear keepalive for NON-HEAD requests with invalid content length + * Clear keepalive unless there is a valid content length or + * if the reply type only has headers (HEAD or IMS). */ - if (request->method != METHOD_HEAD) - if (http->entry->mem_obj->reply->content_length < 0) - request->flags.proxy_keepalive = 0; + if (http->entry->mem_obj->reply->content_length < 0) + if (request->method != METHOD_HEAD) + if (http->entry->mem_obj->reply->sline.status != HTTP_NOT_MODIFIED ) + request->flags.proxy_keepalive = 0; /* Signal keep-alive if needed */ httpHeaderPutStr(hdr, http->flags.accel ? HDR_CONNECTION : HDR_PROXY_CONNECTION, @@ -1662,7 +1664,12 @@ } else if ((done = clientCheckTransferDone(http)) != 0 || size == 0) { debug(33, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd); /* We're finished case */ - if (http->entry->mem_obj->reply->content_length < 0) { + if (http->request->flags.proxy_keepalive && ( + http->request->method == METHOD_HEAD || + http->entry->mem_obj->reply->sline.status == HTTP_NOT_MODIFIED)) { + debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", fd); + clientKeepaliveNextRequest(http); + } else if (http->entry->mem_obj->reply->content_length < 0) { debug(33, 5) ("clientWriteComplete: closing, content_length < 0\n"); comm_close(fd); } else if (!done) {