From: wessels <> Date: Fri, 12 May 2000 09:43:00 +0000 (+0000) Subject: DW: X-Git-Tag: SQUID_3_0_PRE1~1977 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=57ec8214a53f546b9af0054ac12bf5cb6ac51bed;p=thirdparty%2Fsquid.git DW: - The removal of storeClientListSearch broke validation requests. A clientHttpRequest (http) can register itself with two StoreEntrys. One is the old entry that needs validation, and the other is the one to hold the validation response from the origin server. With the new scheme, clientHttpRequest needs and 'old_sc' to go with 'old_entry'. --- diff --git a/src/client_side.cc b/src/client_side.cc index 2b54b42bb9..d2e7c38ae2 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.483 2000/05/12 00:29:06 wessels Exp $ + * $Id: client_side.cc,v 1.484 2000/05/12 03:43:00 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -345,14 +345,13 @@ clientProcessExpired(void *data) } http->request->flags.refresh = 1; http->old_entry = http->entry; + http->old_sc = http->sc; /* * Assert that 'http' is already a client of old_entry. If * it is not, then the beginning of the object data might get * freed from memory before we need to access it. */ -#if STORE_CLIENT_LIST_SEARCH - assert(storeClientListSearch(http->old_entry->mem_obj, http)); -#endif + assert(http->sc->callback_data == http); entry = storeCreateEntry(url, http->log_uri, http->request->flags, @@ -448,6 +447,7 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size) storeUnregister(http->sc, entry, http); storeUnlockObject(entry); entry = http->entry = http->old_entry; + http->sc = http->old_sc; } else if (STORE_PENDING == entry->store_status && 0 == status) { debug(33, 3) ("clientHandleIMSReply: Incomplete headers for '%s'\n", url); if (size >= CLIENT_SOCK_SZ) { @@ -458,6 +458,7 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size) storeUnregister(http->sc, entry, http); storeUnlockObject(entry); entry = http->entry = http->old_entry; + http->sc = http->old_sc; /* continue */ } else { storeClientCopy(http->sc, entry, @@ -486,6 +487,7 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size) httpReplyUpdateOnNotModified(oldentry->mem_obj->reply, mem->reply); storeTimestampsSet(oldentry); storeUnregister(http->sc, entry, http); + http->sc = http->old_sc; storeUnlockObject(entry); entry = http->entry = oldentry; entry->timestamp = squid_curtime; @@ -502,11 +504,12 @@ clientHandleIMSReply(void *data, char *buf, ssize_t size) storeTimestampsSet(http->old_entry); http->log_type = LOG_TCP_REFRESH_HIT; } - storeUnregister(http->sc, http->old_entry, http); + storeUnregister(http->old_sc, http->old_entry, http); storeUnlockObject(http->old_entry); recopy = 0; } http->old_entry = NULL; /* done with old_entry */ + http->old_sc = NULL; assert(!EBIT_TEST(entry->flags, ENTRY_ABORTED)); if (recopy) { storeClientCopy(http->sc, entry, diff --git a/src/structs.h b/src/structs.h index df951909c8..dc4540fdb3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.332 2000/05/12 03:11:40 wessels Exp $ + * $Id: structs.h,v 1.333 2000/05/12 03:43:00 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -845,6 +845,7 @@ struct _clientHttpRequest { ConnStateData *conn; request_t *request; /* Parsed URL ... */ store_client *sc; /* The store_client we're using */ + store_client *old_sc; /* ... for entry to be validated */ char *uri; char *log_uri; struct {