From: wessels <> Date: Fri, 23 Aug 2002 02:26:38 +0000 (+0000) Subject: Noticed that a HEAD request for a cached GET response changes X-Git-Tag: SQUID_3_0_PRE1~830 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d15acfd89560b3e3b400cfee124e5671746e194c;p=thirdparty%2Fsquid.git Noticed that a HEAD request for a cached GET response changes mem_obj->method to HEAD. This looks strange in store.log because the entry got created (swapped out) as GET and later released as HEAD. This new if-block prevents changing the method value. --- diff --git a/src/client_side.cc b/src/client_side.cc index 4fceb4611f..c391e23855 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.585 2002/08/15 18:11:48 hno Exp $ + * $Id: client_side.cc,v 1.586 2002/08/22 20:26:38 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1978,8 +1978,17 @@ clientProcessRequest(clientHttpRequest * http) http->out.offset = 0; if (NULL != http->entry) { storeLockObject(http->entry); - storeCreateMemObject(http->entry, http->uri, http->log_uri); - http->entry->mem_obj->method = r->method; + if (NULL == http->entry->mem_obj) { + /* + * This if-block exists because we don't want to clobber + * a preexiting mem_obj->method value if the mem_obj + * already exists. For example, when a HEAD request + * is a cache hit for a GET response, we want to keep + * the method as GET. + */ + storeCreateMemObject(http->entry, http->uri, http->log_uri); + http->entry->mem_obj->method = r->method; + } http->sc = storeClientListAdd(http->entry, http); #if DELAY_POOLS delaySetStoreClient(http->sc, delayClient(http));