--------------------- PatchSet 7178 Date: 2005/11/22 23:42:07 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: moved client-side proxy_keepalive flag from request_t to ConnStateData. This way it won't be disturbed by ICAP request modification. Members: src/client_side.c:1.47.2.28.2.34->1.47.2.28.2.35 src/forward.c:1.13.6.3.2.12->1.13.6.3.2.13 src/icap_reqmod.c:1.1.2.52->1.1.2.53 src/structs.h:1.48.2.9.2.43->1.48.2.9.2.44 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.47.2.28.2.34 retrieving revision 1.47.2.28.2.35 diff -u -r1.47.2.28.2.34 -r1.47.2.28.2.35 --- squid/src/client_side.c 22 Nov 2005 22:41:48 -0000 1.47.2.28.2.34 +++ squid/src/client_side.c 22 Nov 2005 23:42:07 -0000 1.47.2.28.2.35 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.47.2.28.2.34 2005/11/22 22:41:48 dwsquid Exp $ + * $Id: client_side.c,v 1.47.2.28.2.35 2005/11/22 23:42:07 dwsquid Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1121,7 +1121,7 @@ http_version_t http_ver; httpBuildVersion(&http_ver, 1, 0); /* we are HTTP/1.0, no matter what the client requests... */ if (httpMsgIsPersistent(http_ver, req_hdr)) - request->flags.proxy_keepalive = 1; + http->conn->flags.proxy_keepalive = 1; } } @@ -1480,18 +1480,18 @@ #endif if (httpReplyBodySize(request->method, rep) < 0) { debug(33, 3) ("clientBuildReplyHeader: can't keep-alive, unknown body size\n"); - request->flags.proxy_keepalive = 0; + http->conn->flags.proxy_keepalive = 0; } if (fdUsageHigh() && !request->flags.must_keepalive) { debug(33, 3) ("clientBuildReplyHeader: Not many unused FDs, can't keep-alive\n"); - request->flags.proxy_keepalive = 0; + http->conn->flags.proxy_keepalive = 0; } if (!Config.onoff.client_pconns && !request->flags.must_keepalive) - request->flags.proxy_keepalive = 0; + http->conn->flags.proxy_keepalive = 0; /* Signal keep-alive if needed */ httpHeaderPutStr(hdr, http->flags.accel ? HDR_CONNECTION : HDR_PROXY_CONNECTION, - request->flags.proxy_keepalive ? "keep-alive" : "close"); + http->conn->flags.proxy_keepalive ? "keep-alive" : "close"); #if ADD_X_REQUEST_URI /* * Knowing the URI of the request is useful when debugging persistent @@ -2116,7 +2116,7 @@ * And as this is a malformed HTTP reply we cannot keep * the connection persistent */ - http->request->flags.proxy_keepalive = 0; + conn->flags.proxy_keepalive = 0; } } /* write headers and/or body if any */ @@ -2291,7 +2291,7 @@ * not received any complaints indicating this may be an issue. */ clientEatRequestBody(http); - } else if (http->request->flags.proxy_keepalive) { + } else if (http->conn->flags.proxy_keepalive) { debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", fd); clientKeepaliveNextRequest(http); } else { @@ -3204,7 +3204,7 @@ err = errorCon(ERR_UNSUP_REQ, HTTP_NOT_IMPLEMENTED); err->src_addr = conn->peer.sin_addr; err->request = requestLink(request); - request->flags.proxy_keepalive = 0; + conn->flags.proxy_keepalive = 0; http->al.http.code = err->http_status; http->log_type = LOG_TCP_DENIED; http->entry = clientCreateStoreEntry(http, request->method, null_request_flags); @@ -3333,7 +3333,7 @@ conn->body.bufsize = SQUID_TCP_SO_RCVBUF; clientProcessBody(conn); } else { - if (http->request->flags.proxy_keepalive) { + if (conn->flags.proxy_keepalive) { debug(33, 5) ("clientWriteComplete: FD %d Keeping Alive\n", conn->fd); clientKeepaliveNextRequest(http); } else { Index: squid/src/forward.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/forward.c,v retrieving revision 1.13.6.3.2.12 retrieving revision 1.13.6.3.2.13 diff -u -r1.13.6.3.2.12 -r1.13.6.3.2.13 --- squid/src/forward.c 12 Sep 2005 18:34:41 -0000 1.13.6.3.2.12 +++ squid/src/forward.c 22 Nov 2005 23:42:08 -0000 1.13.6.3.2.13 @@ -1,6 +1,6 @@ /* - * $Id: forward.c,v 1.13.6.3.2.12 2005/09/12 18:34:41 chtsanti Exp $ + * $Id: forward.c,v 1.13.6.3.2.13 2005/11/22 23:42:08 dwsquid Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -526,7 +526,10 @@ * some Netscape browsers have a bug that sends CONNECT * requests as GET's over persistent connections. */ - request->flags.proxy_keepalive = 0; + /* + * The proxy_keepalive flag is now tied to ConnStateData + * instead of request_t + */ /* * Set the dont_retry flag becuase this is not a * transient (network) error; its a bug. Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.c,v retrieving revision 1.1.2.52 retrieving revision 1.1.2.53 diff -u -r1.1.2.52 -r1.1.2.53 --- squid/src/icap_reqmod.c 22 Nov 2005 22:41:48 -0000 1.1.2.52 +++ squid/src/icap_reqmod.c 22 Nov 2005 23:42:08 -0000 1.1.2.53 @@ -1,6 +1,6 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.52 2005/11/22 22:41:48 dwsquid Exp $ + * $Id: icap_reqmod.c,v 1.1.2.53 2005/11/22 23:42:08 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -171,7 +171,7 @@ ErrorState *err; err = errorCon(ERR_UNSUP_REQ, HTTP_NOT_IMPLEMENTED); err->request = requestLink(request); - request->flags.proxy_keepalive = 0; + http->conn->flags.proxy_keepalive = 0; http->entry = clientCreateStoreEntry(http, request->method, null_request_flags); errorAppendEntry(http->entry, err); Index: squid/src/structs.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/structs.h,v retrieving revision 1.48.2.9.2.43 retrieving revision 1.48.2.9.2.44 diff -u -r1.48.2.9.2.43 -r1.48.2.9.2.44 --- squid/src/structs.h 12 Sep 2005 18:34:41 -0000 1.48.2.9.2.43 +++ squid/src/structs.h 22 Nov 2005 23:42:08 -0000 1.48.2.9.2.44 @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.48.2.9.2.43 2005/09/12 18:34:41 chtsanti Exp $ + * $Id: structs.h,v 1.48.2.9.2.44 2005/11/22 23:42:08 dwsquid Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1283,6 +1283,9 @@ int n; time_t until; } defer; + struct { + unsigned int proxy_keepalive:1; + } flags; }; struct _ipcache_addrs { @@ -1761,7 +1764,6 @@ unsigned int cachable:1; unsigned int hierarchical:1; unsigned int loopdetect:1; - unsigned int proxy_keepalive:1; unsigned int proxying:1; unsigned int refresh:1; unsigned int redirected:1;