From: wessels <> Date: Sat, 18 Feb 2006 03:15:35 +0000 (+0000) Subject: Replaced the single-line wrapper function storeEntryReplaceObject X-Git-Tag: SQUID_3_0_PRE4~331 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db237875c5d6e90bc329213724ee6bfd06d3b405;p=thirdparty%2Fsquid.git Replaced the single-line wrapper function storeEntryReplaceObject with direct calls to StoreEntry->replaceHttpReply(); --- diff --git a/src/cache_manager.cc b/src/cache_manager.cc index 285cb391a0..e1cdddcba0 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_manager.cc,v 1.36 2006/02/17 18:10:59 wessels Exp $ + * $Id: cache_manager.cc,v 1.37 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 16 Cache Manager Objects * AUTHOR: Duane Wessels @@ -295,7 +295,7 @@ cachemgrStart(int fd, HttpRequest * request, StoreEntry * entry) httpHeaderPutAuth(&rep->header, "Basic", mgr->action); /* store the reply */ - storeEntryReplaceObject(entry, rep); + entry->replaceHttpReply(rep); entry->expires = squid_curtime; @@ -325,7 +325,7 @@ cachemgrStart(int fd, HttpRequest * request, StoreEntry * entry) -1, /* C-Len */ squid_curtime, /* LMT */ squid_curtime); - storeEntryReplaceObject(entry, rep); + entry->replaceHttpReply(rep); } a->handler(entry); diff --git a/src/client_side_reply.cc b/src/client_side_reply.cc index 3873d54459..fc594f7ae2 100644 --- a/src/client_side_reply.cc +++ b/src/client_side_reply.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side_reply.cc,v 1.95 2006/02/17 18:10:59 wessels Exp $ + * $Id: client_side_reply.cc,v 1.96 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 88 Client-side Reply Routines * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c) @@ -739,7 +739,7 @@ clientReplyContext::cacheHit(StoreIOBuffer result) * reply has a meaningful Age: header. */ e->timestamp = timestamp; - storeEntryReplaceObject(e, temprep); + e->replaceHttpReply(temprep); e->complete(); /* TODO: why put this in the store and then serialise it and then parse it again. * Simply mark the request complete in our context and @@ -826,7 +826,7 @@ clientReplyContext::processMiss() storeReleaseRequest(http->storeEntry()); rep->redirect(http->redirect.status, http->redirect.location); - storeEntryReplaceObject(http->storeEntry(), rep); + http->storeEntry()->replaceHttpReply(rep); http->storeEntry()->complete(); return; } @@ -1033,7 +1033,7 @@ clientReplyContext::purgeDoPurgeHead(StoreEntry *newEntry) r->setHeaders(version, purgeStatus, NULL, NULL, 0, 0, -1); - storeEntryReplaceObject(http->storeEntry(), r); + http->storeEntry()->replaceHttpReply(r); http->storeEntry()->complete(); } @@ -1057,7 +1057,7 @@ clientReplyContext::traceReply(clientStreamNode * node) HttpVersion version(1,0); rep->setHeaders(version, HTTP_OK, NULL, "text/plain", http->request->prefixLen(), 0, squid_curtime); - storeEntryReplaceObject(http->storeEntry(), rep); + http->storeEntry()->replaceHttpReply(rep); http->request->swapOut(http->storeEntry()); http->storeEntry()->complete(); } diff --git a/src/errorpage.cc b/src/errorpage.cc index a9e96e825e..60ffc6fb7a 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.207 2006/02/17 18:10:59 wessels Exp $ + * $Id: errorpage.cc,v 1.208 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -376,7 +376,7 @@ errorAppendEntry(StoreEntry * entry, ErrorState * err) * on 407/401 responses, and do not check the accel state on 401/407 responses */ authenticateFixHeader(rep, err->auth_user_request, err->request, 0, 1); - storeEntryReplaceObject(entry, rep); + entry->replaceHttpReply(rep); EBIT_CLR(entry->flags, ENTRY_FWD_HDR_WAIT); storeBufferFlush(entry); entry->complete(); diff --git a/src/ftp.cc b/src/ftp.cc index 6c6a7741e4..43a1c36ebd 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.384 2006/02/17 18:10:59 wessels Exp $ + * $Id: ftp.cc,v 1.385 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1469,7 +1469,7 @@ FtpStateData::start() /* create appropriate reply */ HttpReply *reply = ftpAuthRequired(request, realm); - storeEntryReplaceObject(entry, reply); + entry->replaceHttpReply(reply); fwd->complete(); @@ -3167,7 +3167,7 @@ FtpStateData::appendSuccessHeader() #endif - storeEntryReplaceObject(e, reply); + e->replaceHttpReply(reply); storeTimestampsSet(e); @@ -3350,7 +3350,7 @@ FtpStateData::takeAdaptedHeaders(HttpReply *rep) } assert (rep); - storeEntryReplaceObject(entry, rep); + entry->replaceHttpReply(rep); HTTPMSGUNLOCK(reply); reply = HTTPMSGLOCK(rep); diff --git a/src/http.cc b/src/http.cc index 1eac276475..55509eeb2e 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.486 2006/02/17 18:10:59 wessels Exp $ + * $Id: http.cc,v 1.487 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -696,7 +696,7 @@ HttpStateData::failReply(HttpReply *reply, http_status const & status) { reply->sline.version = HttpVersion(1, 0); reply->sline.status = status; - storeEntryReplaceObject (entry, reply); + entry->replaceHttpReply(reply); if (eof == 1) { transactionComplete(); @@ -806,7 +806,7 @@ HttpStateData::processReplyHeader() #endif - storeEntryReplaceObject(entry, reply); + entry->replaceHttpReply(reply); haveParsedReplyHeaders(); @@ -1992,7 +1992,7 @@ HttpStateData::icapAclCheckDone(ICAPServiceRep::Pointer service) if (service == NULL) { // handle case where no service is selected; - storeEntryReplaceObject(entry, reply); + entry->replaceHttpReply(reply); haveParsedReplyHeaders(); processReplyBody(); @@ -2042,7 +2042,7 @@ HttpStateData::takeAdaptedHeaders(HttpReply *rep) } assert (rep); - storeEntryReplaceObject(entry, rep); + entry->replaceHttpReply(rep); HTTPMSGUNLOCK(reply); reply = HTTPMSGLOCK(rep); diff --git a/src/internal.cc b/src/internal.cc index 5b20febacf..1eb67af8aa 100644 --- a/src/internal.cc +++ b/src/internal.cc @@ -1,6 +1,6 @@ /* - * $Id: internal.cc,v 1.36 2006/02/17 18:10:59 wessels Exp $ + * $Id: internal.cc,v 1.37 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 76 Internal Squid Object handling * AUTHOR: Duane, Alex, Henrik @@ -70,7 +70,7 @@ internalStart(HttpRequest * request, StoreEntry * entry) strlen(msgbuf), squid_curtime, -2); - storeEntryReplaceObject(entry, reply); + entry->replaceHttpReply(reply); storeAppend(entry, msgbuf, strlen(msgbuf)); entry->complete(); } else { diff --git a/src/mime.cc b/src/mime.cc index 6d811e1e57..9d36b6dc3b 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -1,6 +1,6 @@ /* - * $Id: mime.cc,v 1.122 2006/02/17 18:10:59 wessels Exp $ + * $Id: mime.cc,v 1.123 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -620,7 +620,7 @@ MimeIcon::created (StoreEntry *newEntry) httpHeaderPutCc(&reply->header, reply->cache_control); - storeEntryReplaceObject(e, reply); + e->replaceHttpReply(reply); /* read the file into the buffer and append it to store */ buf = (char *)memAllocate(MEM_4K_BUF); diff --git a/src/net_db.cc b/src/net_db.cc index c744da05f0..bc7b05a27c 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $Id: net_db.cc,v 1.182 2006/02/17 18:10:59 wessels Exp $ + * $Id: net_db.cc,v 1.183 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -1210,7 +1210,7 @@ netdbBinaryExchange(StoreEntry * s) storeBuffer(s); HttpVersion version(1, 0); reply->setHeaders(version, HTTP_OK, "OK", NULL, -1, squid_curtime, -2); - storeEntryReplaceObject(s, reply); + s->replaceHttpReply(reply); rec_sz = 0; rec_sz += 1 + sizeof(addr.s_addr); rec_sz += 1 + sizeof(int); @@ -1270,7 +1270,7 @@ netdbBinaryExchange(StoreEntry * s) HttpVersion version(1,0); reply->setHeaders(version, HTTP_BAD_REQUEST, "Bad Request", NULL, -1, squid_curtime, -2); - storeEntryReplaceObject(s, reply); + s->replaceHttpReply(reply); storeAppendPrintf(s, "NETDB support not compiled into this Squid cache.\n"); #endif diff --git a/src/store.cc b/src/store.cc index 866d7bdb35..5ebc39b2f2 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.583 2006/01/23 20:04:24 wessels Exp $ + * $Id: store.cc,v 1.584 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -1755,19 +1755,14 @@ storeSwapFileNumberSet(StoreEntry * e, sfileno filn) #endif -/* Replace a store entry with +/* + * Replace a store entry with * a new reply. This eats the reply. */ -void -storeEntryReplaceObject(StoreEntry * e, HttpReply * rep) -{ - e->replaceHttpReply(rep); -} - void StoreEntry::replaceHttpReply(HttpReply *rep) { - debug(20, 3) ("storeEntryReplaceObject: %s\n", storeUrl(this)); + debug(20, 3) ("StoreEntry::replaceHttpReply: %s\n", storeUrl(this)); Packer p; if (!mem_obj) { @@ -1777,14 +1772,6 @@ StoreEntry::replaceHttpReply(HttpReply *rep) mem_obj->replaceHttpReply(rep); -#if OLD - /* TODO: check that there is at most 1 store client ? */ - HttpReply *myrep = (HttpReply *)e->getReply(); /* we are allowed to do this */ - - /* move info to the mem_obj->reply */ - myrep->absorb(rep); -#endif - /* TODO: when we store headers serparately remove the header portion */ /* TODO: mark the length of the headers ? */ /* We ONLY want the headers */ diff --git a/src/store_digest.cc b/src/store_digest.cc index eadd1e2950..f340fc28e9 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: store_digest.cc,v 1.62 2006/02/17 18:10:59 wessels Exp $ + * $Id: store_digest.cc,v 1.63 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 71 Store Digest Manager * AUTHOR: Alex Rousskov @@ -431,7 +431,7 @@ storeDigestRewriteResume(void) debug(71, 3) ("storeDigestRewrite: entry expires on %ld (%+d)\n", (long int) rep->expires, (int) (rep->expires - squid_curtime)); storeBuffer(e); - storeEntryReplaceObject(e, rep); + e->replaceHttpReply(rep); storeDigestCBlockSwapOut(e); storeBufferFlush(e); eventAdd("storeDigestSwapOutStep", storeDigestSwapOutStep, sd_state.rewrite_lock, 0.0, 1); diff --git a/src/urn.cc b/src/urn.cc index ae695f1898..ac3388a6f3 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -1,6 +1,6 @@ /* - * $Id: urn.cc,v 1.95 2006/02/17 18:10:59 wessels Exp $ + * $Id: urn.cc,v 1.96 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 52 URN Parsing * AUTHOR: Kostas Anagnostakis @@ -448,7 +448,7 @@ urnHandleReply(void *data, StoreIOBuffer result) httpBodySet(&rep->body, mb); /* don't clean or delete mb; rep->body owns it now */ - storeEntryReplaceObject(e, rep); + e->replaceHttpReply(rep); e->complete(); for (i = 0; i < urlcnt; i++) { diff --git a/src/whois.cc b/src/whois.cc index 3495553e2f..c07017165a 100644 --- a/src/whois.cc +++ b/src/whois.cc @@ -1,6 +1,6 @@ /* - * $Id: whois.cc,v 1.32 2006/01/03 17:22:31 wessels Exp $ + * $Id: whois.cc,v 1.33 2006/02/17 20:15:35 wessels Exp $ * * DEBUG: section 75 WHOIS protocol * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -123,7 +123,7 @@ WhoisState::setReplyToOK(StoreEntry *entry) storeBuffer(entry); HttpVersion version(1, 0); reply->setHeaders(version, HTTP_OK, "Gatewaying", "text/plain", -1, -1, -2); - storeEntryReplaceObject (entry, reply); + entry->replaceHttpReply(reply); } void