--------------------- PatchSet 7045 Date: 2005/09/22 19:59:48 Author: chtsanti Branch: icap-2_5 Tag: (none) Log: A try to make proxy-keepalive works using icap client..... Members: src/icap_reqmod.c:1.1.2.45->1.1.2.46 Index: squid/src/icap_reqmod.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap_reqmod.c,v retrieving revision 1.1.2.45 retrieving revision 1.1.2.46 diff -u -r1.1.2.45 -r1.1.2.46 --- squid/src/icap_reqmod.c 12 Sep 2005 17:15:35 -0000 1.1.2.45 +++ squid/src/icap_reqmod.c 22 Sep 2005 19:59:48 -0000 1.1.2.46 @@ -1,6 +1,6 @@ /* - * $Id: icap_reqmod.c,v 1.1.2.45 2005/09/12 17:15:35 chtsanti Exp $ + * $Id: icap_reqmod.c,v 1.1.2.46 2005/09/22 19:59:48 chtsanti Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -38,6 +38,9 @@ /* * These once-static functions are required to be global for ICAP */ + +#define ICAP_PROXY_KEEP_ALIVE 0 + PF clientReadRequest; PF connStateFree; int clientCheckContentLength(request_t * r); @@ -107,8 +110,13 @@ http->start = icap->reqmod.start; http->conn = cbdataAlloc(ConnStateData); http->conn->fd = icap->reqmod.client_fd; +#if ICAP_PROXY_KEEP_ALIVE + http->conn->in.size = CLIENT_REQ_BUF_SZ; + http->conn->in.buf = memAllocate(MEM_CLIENT_REQ_BUF); +#else http->conn->in.size = 0; http->conn->in.buf = NULL; +#endif http->conn->log_addr = icap->reqmod.log_addr; http->conn->chr = http; http->icap_reqmod = NULL; @@ -312,6 +320,11 @@ request->auth_user_request = icap->request->auth_user_request; authenticateAuthUserRequestLock(request->auth_user_request); } +#if ICAP_PROXY_KEEP_ALIVE + const HttpHeader *req_hdr = &request->header; + if (httpMsgIsPersistent(http_ver, req_hdr)) + request->flags.proxy_keepalive = 1; +#endif icapReqModInterpretHttpRequest(icap, request); xfree(inbuf); }