--------------------- PatchSet 5251 Date: 2002/10/06 03:52:33 Author: rbcollins Branch: rbcollins_cxxtest Tag: (none) Log: manual updates for merges that will fail Members: src/Makefile.am:1.29.2.7->1.29.2.8 src/Store.h:1.1.2.4->1.1.2.5 src/client_side_reply.cc:1.1.2.4->1.1.2.5 src/htcp.cc:1.1.2.1->1.1.2.2 src/http.cc:1.1.2.5->1.1.2.6 src/store.cc:1.1.2.5->1.1.2.6 Index: squid/src/Makefile.am =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Makefile.am,v retrieving revision 1.29.2.7 retrieving revision 1.29.2.8 diff -u -r1.29.2.7 -r1.29.2.8 --- squid/src/Makefile.am 5 Oct 2002 10:36:04 -0000 1.29.2.7 +++ squid/src/Makefile.am 6 Oct 2002 03:52:33 -0000 1.29.2.8 @@ -220,7 +220,7 @@ typedefs.h \ $(UNLINKDSOURCE) \ url.c \ - urn.c \ + urn.cc \ useragent.c \ wais.c \ wccp.c \ Index: squid/src/Store.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/Store.h,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/src/Store.h 5 Oct 2002 10:36:04 -0000 1.1.2.4 +++ squid/src/Store.h 6 Oct 2002 03:52:33 -0000 1.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: Store.h,v 1.1.2.4 2002/10/05 10:36:04 rbcollins Exp $ + * $Id: Store.h,v 1.1.2.5 2002/10/06 03:52:33 rbcollins Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -66,6 +66,7 @@ static size_t inUseCount(); static void getPublicByRequestMethod (StoreClient *aClient, request_t * request, const method_t method); static void getPublicByRequest (StoreClient *aClient, request_t *request); + static void getPublic(StoreClient *aClient, const char *uri, const method_t method); virtual bool isNull() {return false;} void *operator new (unsigned int byteCount); void operator delete (void *address); Index: squid/src/client_side_reply.cc =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/client_side_reply.cc,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -r1.1.2.4 -r1.1.2.5 --- squid/src/client_side_reply.cc 5 Oct 2002 13:10:18 -0000 1.1.2.4 +++ squid/src/client_side_reply.cc 6 Oct 2002 03:52:33 -0000 1.1.2.5 @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.1.2.4 2002/10/05 13:10:18 rbcollins Exp $ + * $Id: client_side_reply.cc,v 1.1.2.5 2002/10/06 03:52:33 rbcollins Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -1638,10 +1638,8 @@ 3) ("clientSendMoreData: Appending %d bytes after %d bytes of headers\n", (int) body_size, rep->hdr_sz); - ch = aclChecklistCreate(Config.accessList.reply, http->request, NULL); + ch = clientAclChecklistCreate(Config.accessList.reply, http); ch->reply = rep; - if (http->conn) - ch->conn = cbdataReference(http->conn); /* acl.c frees */ rv = aclCheckFast(Config.accessList.reply, ch); aclChecklistFree(ch); ch = NULL; Index: squid/src/htcp.cc =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/htcp.cc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- squid/src/htcp.cc 5 Oct 2002 10:36:04 -0000 1.1.2.1 +++ squid/src/htcp.cc 6 Oct 2002 03:52:33 -0000 1.1.2.2 @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.1.2.1 2002/10/05 10:36:04 rbcollins Exp $ + * $Id: htcp.cc,v 1.1.2.2 2002/10/06 03:52:33 rbcollins Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -977,7 +977,7 @@ stuff.S.method = (char *) RequestMethodStr[req->method]; stuff.S.uri = (char *) storeUrl(e); stuff.S.version = vbuf; - httpBuildRequestHeader(req, req, e, &hdr, -1, flags); + httpBuildRequestHeader(req, req, e, &hdr, flags); memBufDefInit(&mb); packerToMemInit(&pa, &mb); httpHeaderPackInto(&hdr, &pa); Index: squid/src/http.cc =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/http.cc,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid/src/http.cc 5 Oct 2002 06:39:11 -0000 1.1.2.5 +++ squid/src/http.cc 6 Oct 2002 03:52:33 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.1.2.5 2002/10/05 06:39:11 rbcollins Exp $ + * $Id: http.cc,v 1.1.2.6 2002/10/06 03:52:33 rbcollins Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -753,7 +753,6 @@ request_t * orig_request, StoreEntry * entry, HttpHeader * hdr_out, - int cfd, http_state_flags flags) { /* building buffer for complex strings */ @@ -857,7 +856,10 @@ } /* append X-Forwarded-For */ strFwd = httpHeaderGetList(hdr_in, HDR_X_FORWARDED_FOR); - strListAdd(&strFwd, (cfd < 0 ? "unknown" : fd_table[cfd].ipaddr), ','); + if (opt_forwarded_for && orig_request->client_addr.s_addr != no_addr.s_addr) + strListAdd(&strFwd, inet_ntoa(orig_request->client_addr), ','); + else + strListAdd(&strFwd, "unknown", ','); httpHeaderPutStr(hdr_out, HDR_X_FORWARDED_FOR, strBuf(strFwd)); stringClean(&strFwd); @@ -932,7 +934,6 @@ request_t * orig_request, StoreEntry * entry, MemBuf * mb, - int cfd, http_state_flags flags) { const int offset = mb->size; @@ -943,7 +944,7 @@ { HttpHeader hdr; Packer p; - httpBuildRequestHeader(request, orig_request, entry, &hdr, cfd, flags); + httpBuildRequestHeader(request, orig_request, entry, &hdr, flags); packerToMemInit(&p, mb); httpHeaderPackInto(&hdr, &p); httpHeaderClean(&hdr); @@ -960,7 +961,6 @@ MemBuf mb; request_t *req = httpState->request; StoreEntry *entry = httpState->entry; - int cfd; peer *p = httpState->_peer; CWCB *sendHeaderDone; @@ -971,13 +971,6 @@ else sendHeaderDone = httpSendComplete; - if (!opt_forwarded_for) - cfd = -1; - else if (entry->mem_obj == NULL) - cfd = -1; - else - cfd = entry->mem_obj->fd; - assert(-1 == cfd || FD_SOCKET == fd_table[cfd].type); if (p != NULL) httpState->flags.proxying = 1; else @@ -1002,7 +995,6 @@ httpState->orig_request, entry, &mb, - cfd, httpState->flags); debug(11, 6) ("httpSendRequest: FD %d:\n%s\n", httpState->fd, mb.buf); comm_write_mbuf(httpState->fd, mb, sendHeaderDone, httpState); Index: squid/src/store.cc =================================================================== RCS file: /cvsroot/squid-sf//squid/src/Attic/store.cc,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -r1.1.2.5 -r1.1.2.6 --- squid/src/store.cc 5 Oct 2002 13:10:18 -0000 1.1.2.5 +++ squid/src/store.cc 6 Oct 2002 03:52:33 -0000 1.1.2.6 @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.1.2.5 2002/10/05 13:10:18 rbcollins Exp $ + * $Id: store.cc,v 1.1.2.6 2002/10/06 03:52:33 rbcollins Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -383,6 +383,16 @@ aClient->created (result); } +void +_StoreEntry::getPublic (StoreClient *aClient, const char *uri, const method_t method) +{ + assert (aClient); + _StoreEntry *result = storeGetPublic (uri, method); + if (!result) + result = NullStoreEntry::getInstance(); + aClient->created (result); +} + StoreEntry * storeGetPublic(const char *uri, const method_t method) {