--------------------- PatchSet 8935 Date: 2007/02/20 13:22:21 Author: adri Branch: storework-cutaway Tag: (none) Log: Strip out clientCacheHit(), PURGE method, internal methods. Members: src/client_side.c:1.168.4.3->1.168.4.4 Index: squid/src/client_side.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/client_side.c,v retrieving revision 1.168.4.3 retrieving revision 1.168.4.4 diff -u -r1.168.4.3 -r1.168.4.4 --- squid/src/client_side.c 20 Feb 2007 09:29:42 -0000 1.168.4.3 +++ squid/src/client_side.c 20 Feb 2007 13:22:21 -0000 1.168.4.4 @@ -1,6 +1,6 @@ /* - * $Id: client_side.c,v 1.168.4.3 2007/02/20 09:29:42 adri Exp $ + * $Id: client_side.c,v 1.168.4.4 2007/02/20 13:22:21 adri Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -134,7 +134,6 @@ static int clientOnlyIfCached(clientHttpRequest * http); static STCB clientSendMoreData; static STCB clientSendMoreHeaderData; -static STCB clientCacheHit; static void clientSetKeepaliveFlag(clientHttpRequest *); static void clientPackRangeHdr(const HttpReply * rep, const HttpHdrRangeSpec * spec, String boundary, MemBuf * mb); static void clientPackTermBound(String boundary, MemBuf * mb); @@ -1555,64 +1554,6 @@ return rep; } -/* - * clientCacheHit should only be called until the HTTP reply headers - * have been parsed. Normally this should be a single call, but - * it might take more than one. As soon as we have the headers, - * we hand off to clientSendMoreData, clientProcessExpired, or - * clientProcessMiss. - */ -static void -clientCacheHit(void *data, char *buf, ssize_t size) -{ - clientHttpRequest *http = data; - StoreEntry *e = http->entry; - MemObject *mem; - debug(33, 3) ("clientCacheHit: %s, %d bytes\n", http->uri, (int) size); - http->flags.hit = 0; - if (http->entry == NULL) { - debug(33, 3) ("clientCacheHit: request aborted\n"); - return; - } else if (size <= 0) { - /* swap in failure */ - debug(33, 3) ("clientCacheHit: swapin failure for %s\n", http->uri); - http->log_type = LOG_TCP_SWAPFAIL_MISS; - if ((e = http->entry)) { - http->entry = NULL; - storeClientUnregister(http->sc, e, http); - http->sc = NULL; - storeUnlockObject(e); - } - clientProcessMiss(http); - return; - } - assert(size > 0); - mem = e->mem_obj; - assert(!EBIT_TEST(e->flags, ENTRY_ABORTED)); - if (!memHaveHeaders(mem)) { - /* - * we don't have full reply headers yet; either wait for more or - * punt to clientProcessMiss. - */ - if (e->mem_status == IN_MEMORY || e->store_status == STORE_OK) { - clientProcessMiss(http); - } else if (size == CLIENT_SOCK_SZ && http->out.offset == 0) { - clientProcessMiss(http); - } else { - debug(33, 3) ("clientCacheHit: waiting for HTTP reply headers\n"); - storeClientCopy(http->sc, e, - http->out.offset + size, - http->out.offset, - CLIENT_SOCK_SZ, - buf, - clientCacheHit, - http); - } - return; - } - clientProcessMiss(http); -} - /* put terminating boundary for multiparts */ static void clientPackTermBound(String boundary, MemBuf * mb) @@ -2512,10 +2453,8 @@ { request_t *r = http->request; StoreEntry *e; - if (r->flags.cachable || r->flags.internal) - e = http->entry = storeGetPublicByRequest(r); - else - e = http->entry = NULL; + /* We're failing all lookups for now */ + e = http->entry = NULL; /* Release IP-cache entries on reload */ if (r->flags.nocache) { #if USE_DNSSERVERS @@ -2640,28 +2579,11 @@ log_tags[http->log_type], http->uri); http->out.offset = 0; - if (NULL != http->entry) { - storeLockObject(http->entry); - if (http->entry->store_status == STORE_PENDING && http->entry->mem_obj) { - if (http->entry->mem_obj->request) - r->hier = http->entry->mem_obj->request->hier; - } - storeCreateMemObject(http->entry, http->uri); - http->entry->mem_obj->method = r->method; - http->sc = storeClientRegister(http->entry, http); -#if DELAY_POOLS - delaySetStoreClient(http->sc, delayClient(http)); -#endif - storeClientCopy(http->sc, http->entry, - http->out.offset, - http->out.offset, - CLIENT_SOCK_SZ, http->readbuf, - clientCacheHit, - http); - } else { - /* MISS CASE, http->log_type is already set! */ - clientProcessMiss(http); - } + assert(http->entry == NULL); + /* Removed http->entry handler; we're only handling 'miss' for now */ + /* MISS CASE, http->log_type is already set! */ + /* XXX [ahc] do we have to set http->log_type ourself here? */ + clientProcessMiss(http); } /* @@ -2680,20 +2602,8 @@ * We might have a left-over StoreEntry from a failed cache hit * or IMS request. */ - if (http->entry) { - if (EBIT_TEST(http->entry->flags, ENTRY_SPECIAL)) { - debug(33, 0) ("clientProcessMiss: miss on a special object (%s).\n", url); - debug(33, 0) ("\tlog_type = %s\n", log_tags[http->log_type]); - storeEntryDump(http->entry, 1); - } - /* touch timestamp for refresh_stale_hit */ - if (http->entry->mem_obj) - http->entry->mem_obj->refresh_timestamp = squid_curtime; - storeClientUnregister(http->sc, http->entry, http); - http->sc = NULL; - storeUnlockObject(http->entry); - http->entry = NULL; - } + /* remove ENTRY_SPECIAL check and the refresh on http->entry existing but it being a MISS */ + assert(http->entry == NULL); if (clientOnlyIfCached(http)) { clientProcessOnlyIfCachedMiss(http); return;