Sun Dec 12 18:37:57 CET 1999 Modified Files in squid/src HttpMsg.c cf.data.pre client_side.c http.c Changed pconn_timeout to apply to client connections as well, and added the rule that persistent connections will be disabled if pconn_timeout is < 10 seconds. Index: squid/src/HttpMsg.c diff -u squid/src/HttpMsg.c:1.1.1.3 squid/src/HttpMsg.c:1.1.1.3.66.1 --- squid/src/HttpMsg.c:1.1.1.3 Wed Aug 19 03:20:21 1998 +++ squid/src/HttpMsg.c Sun Dec 12 18:37:52 1999 @@ -91,7 +91,12 @@ int httpMsgIsPersistent(float http_ver, const HttpHeader * hdr) { - if (http_ver >= 1.1) { + if (Config.Timeout.pconn < 10) { + /* + * Persistent connections are disabled by configuration + */ + return 0; + } else if (http_ver >= 1.1) { /* * for modern versions of HTTP: persistent unless there is * a "Connection: close" header. Index: squid/src/cf.data.pre diff -u squid/src/cf.data.pre:1.1.1.40.2.11 squid/src/cf.data.pre:1.1.1.40.2.12 --- squid/src/cf.data.pre:1.1.1.40.2.11 Sat Nov 27 01:16:43 1999 +++ squid/src/cf.data.pre Sun Dec 12 18:37:52 1999 @@ -1350,13 +1350,14 @@ NAME: request_timeout TYPE: time_t LOC: Config.Timeout.request -DEFAULT: 30 seconds +DEFAULT: 5 minutes DOC_START - How long to wait for an HTTP request after connection - establishment. For persistent connections, wait this long - after the previous request completes. + How long to wait for the first HTTP request after connection + establishment. + + For persistent connections idle timeout, see pconn_timeout. -request_timeout 30 seconds +request_timeout 5 minutes DOC_END @@ -1406,8 +1407,12 @@ LOC: Config.Timeout.pconn DEFAULT: 120 seconds DOC_START - Timeout for idle persistent connections to servers and other - proxies. + Timeout for idle persistent connections to clients, servers + and other proxies. + + Persistent connections will be disabled if this is less than 10 + seconds. + pconn_timeout 120 seconds DOC_END Index: squid/src/client_side.c diff -u squid/src/client_side.c:1.1.1.45.2.12 squid/src/client_side.c:1.1.1.45.2.13 --- squid/src/client_side.c:1.1.1.45.2.12 Wed Nov 24 22:19:14 1999 +++ squid/src/client_side.c Sun Dec 12 18:37:53 1999 @@ -1610,7 +1610,7 @@ /* * Set the timeout BEFORE calling clientReadRequest(). */ - commSetTimeout(conn->fd, Config.Timeout.request, requestTimeout, conn); + commSetTimeout(conn->fd, Config.Timeout.pconn, requestTimeout, conn); clientReadRequest(conn->fd, conn); /* Read next request */ /* * Note, the FD may be closed at this point. @@ -2194,10 +2194,9 @@ } /* * Don't reset the timeout value here. The timeout value will be - * set to Config.Timeout.request by httpAccept() and - * clientWriteComplete(), and should apply to the request as a - * whole, not individual read() calls. Plus, it breaks our - * lame half-close detection + * set to by httpAccept() and clientWriteComplete(), and should + * apply to the request headers as a whole, not individual read() + * calls. Plus, it breaks our lame half-close detection */ commSetSelect(fd, COMM_SELECT_READ, clientReadRequest, conn, 0); if (size == 0) { Index: squid/src/http.c diff -u squid/src/http.c:1.1.1.38.2.6 squid/src/http.c:1.1.1.38.2.7 --- squid/src/http.c:1.1.1.38.2.6 Fri Nov 19 09:27:51 1999 +++ squid/src/http.c Sun Dec 12 18:37:56 1999 @@ -852,7 +852,9 @@ /* * Is keep-alive okay for all request methods? */ - if (p == NULL) + if (Config.Timeout.pconn < 10) + httpState->flags.keepalive = 0; + else if (p == NULL) httpState->flags.keepalive = 1; else if (p->stats.n_keepalives_sent < 10) httpState->flags.keepalive = 1;