--------------------- PatchSet 5900 Date: 2003/08/21 23:35:12 Author: dwsquid Branch: icap-2_5 Tag: (none) Log: minor changes to debugging and comments Members: src/icap.c:1.1.16.15->1.1.16.16 Index: squid/src/icap.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/icap.c,v retrieving revision 1.1.16.15 retrieving revision 1.1.16.16 diff -u -r1.1.16.15 -r1.1.16.16 --- squid/src/icap.c 21 Aug 2003 23:27:42 -0000 1.1.16.15 +++ squid/src/icap.c 21 Aug 2003 23:35:12 -0000 1.1.16.16 @@ -1,5 +1,5 @@ /* - * $Id: icap.c,v 1.1.16.15 2003/08/21 23:27:42 dwsquid Exp $ + * $Id: icap.c,v 1.1.16.16 2003/08/21 23:35:12 dwsquid Exp $ * * DEBUG: section 81 Internet Content Adaptation Protocol (ICAP) Client * AUTHOR: Geetha Manjunath, Hewlett Packard Company @@ -407,6 +407,8 @@ int icap_fd = icap->icap_fd; icap_service *service; + debug(81, 5) ("icapSendReqMod FD %d\n", fd); + if (req->method == METHOD_POST) { /* TODO: * Data is usually missing. Sending of data has to be postponed until @@ -436,13 +438,6 @@ memBufDefInit(&mb); memBufDefInit(&mb_hdr); - - /* memBufPrintf(&buf, ...); - * * memBufAppend(MemBuf * mb, const char *buf, mb_size_t sz) - * * comm_write_mbuf(fd, buf, handler, data); - * * -- memBufClean(&buf); - * * memBufPrintf(mb, "%s %s HTTP/1.0\r\n", - */ proxy_req = requestCreate(req->method, PROTO_NONE, storeUrl(httpState->entry)); requestLink(proxy_req); httpBuildRequestPrefix(proxy_req, @@ -469,6 +464,7 @@ memBufAppend(&mb, crlf, 2); debug(81, 3) ("icapSendReqMod: FD %d:\n%s\n", httpState->fd, mb.buf); cbdataLock(httpState); + debug(81, 5) ("icapSendRespMod: FD %d writing {%s}\n", icap->icap_fd, mb.buf); comm_write_mbuf(icap_fd, mb, icapSendReqModDone, httpState); } @@ -517,6 +513,8 @@ commSetTimeout(icap->icap_fd, Config.Timeout.connect, icapConnectTimeout, httpState); cbdataLock(httpState); + debug(81, 3) ("FD %d, connecting to %s:%d\n", icap->icap_fd, + service->hostname, service->port); commConnectStart(icap->icap_fd, service->hostname, service->port, icapSendReqMod, httpState); /* Calls icapSendReqMod after connection is started */ @@ -610,6 +608,7 @@ * Read the ICAP header only - leave the rest */ len = read(fd, icap_header, headlen); + debug(81, 5) ("icapRespModReadReply: read() returns %d\n", len); if (len > 0) { icap_header[headlen] = '\0'; debug(81, 3) ("Read icap header : <%s>\n", icap_header); @@ -1104,7 +1103,7 @@ icap->chunk_size = -1; memBufDefInit(&icap->buffer); - debug(81, 3) ("New ICAP connection: fd %d\n", fd); + debug(81, 3) ("FD %d: New ICAP connection\n", fd); return icap; } @@ -1378,7 +1377,7 @@ if (end <= start) { /* no line found, need more code here, now we are in deep trouble, buffer stops with */ /* half a chunk size line. For now stop here. */ - icap->chunk_size = -2; // we are done + icap->chunk_size = -2; /* we are done */ return nextStart; } @@ -1411,7 +1410,7 @@ } else { if (!(c == ';' || c == ' ' || c == '\t')) { /*Syntax error: Chunksize expected. */ - icap->chunk_size = -2; // we are done + icap->chunk_size = -2; /* we are done */ return nextStart; }