From: wessels <> Date: Wed, 19 Aug 1998 12:05:51 +0000 (+0000) Subject: very preliminary PPNR_WIP code X-Git-Tag: SQUID_3_0_PRE1~2844 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7e3e1d014a6ca5fad4b32337ef8be6865622a33f;p=thirdparty%2Fsquid.git very preliminary PPNR_WIP code --- diff --git a/src/enums.h b/src/enums.h index 38aa578046..841e0efd2f 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.118 1998/08/17 22:04:58 wessels Exp $ + * $Id: enums.h,v 1.119 1998/08/19 06:05:51 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -445,7 +445,11 @@ enum { ENTRY_CACHABLE, ENTRY_DISPATCHED, KEY_PRIVATE, +#ifndef PPNR_WIP ENTRY_UNUSED_08, +#else + ENTRY_FWD_HDR_WAIT, +#endif /* PPNR_WIP */ ENTRY_NEGCACHED, ENTRY_VALIDATED, ENTRY_BAD_LENGTH diff --git a/src/forward.cc b/src/forward.cc index 14fc9f9879..172c6a111b 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.24 1998/08/17 23:50:16 wessels Exp $ + * $Id: forward.cc,v 1.25 1998/08/19 06:05:52 wessels Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -404,6 +404,9 @@ fwdCheckDeferRead(int fdnotused, void *data) void fwdFail(FwdState * fwdState, int err_code, http_status http_code, int xerrno) { +#ifdef PPNR_WIP + assert(EBIT_TEST(fwdState->entry->flag, ENTRY_FWD_HDR_WAIT)); +#endif /* PPNR_WIP */ debug(17, 3) ("fwdFail: %s \"%s\"\n\t%s\n", err_type_str[err_code], httpStatusString(http_code), diff --git a/src/http.cc b/src/http.cc index 4d8f6950f4..0941c0e026 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.308 1998/08/18 22:42:19 wessels Exp $ + * $Id: http.cc,v 1.309 1998/08/19 06:05:53 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -427,11 +427,23 @@ httpReadReply(int fd, void *data) * we want to process the reply headers. */ httpProcessReplyHeader(httpState, buf, len); +#ifdef PPNR_WIP + storePPNR(entry); +#endif /* PPNR_WIP */ storeComplete(entry); /* deallocates mem_obj->request */ comm_close(fd); } else { +#ifndef PPNR_WIP if (httpState->reply_hdr_state < 2) +#else + if (httpState->reply_hdr_state < 2) { +#endif /* PPNR_WIP */ httpProcessReplyHeader(httpState, buf, len); +#ifdef PPNR_WIP + if (httpState->reply_hdr_state == 2) + storePPNR(entry); + } +#endif /* PPNR_WIP */ storeAppend(entry, buf, len); #ifdef OPTIMISTIC_IO if (entry->store_status == STORE_ABORTED) { diff --git a/src/protos.h b/src/protos.h index c8d84e29a0..abac01d533 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.250 1998/08/17 23:00:39 wessels Exp $ + * $Id: protos.h,v 1.251 1998/08/19 06:05:54 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -731,6 +731,9 @@ extern StoreEntry *storeGet(const cache_key *); extern StoreEntry *storeCreateEntry(const char *, const char *, int, method_t); extern void storeSetPublicKey(StoreEntry *); extern void storeComplete(StoreEntry *); +#ifdef PPNR_WIP +extern void storePPNR(StoreEntry *); +#endif /* PPNR_WIP */ extern void storeInit(void); extern int storeClientWaiting(const StoreEntry *); extern void storeAbort(StoreEntry *, int); diff --git a/src/store.cc b/src/store.cc index 2b1c97f9d5..11a9ac0d46 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.445 1998/08/18 22:42:21 wessels Exp $ + * $Id: store.cc,v 1.446 1998/08/19 06:05:55 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -357,6 +357,9 @@ storeCreateEntry(const char *url, const char *log_url, int flags, method_t metho e->timestamp = 0; /* set in storeTimestampsSet() */ e->ping_status = PING_NONE; EBIT_SET(e->flag, ENTRY_VALIDATED); +#ifdef PPNR_WIP + EBIT_SET(e->flag, ENTRY_FWD_HDR_WAIT); +#endif /* PPNR_WIP */ return e; } @@ -476,6 +479,15 @@ storeComplete(StoreEntry * e) #endif InvokeHandlers(e); storeCheckSwapOut(e); +#ifdef PPNR_WIP +} + +void +storePPNR(StoreEntry *e) +{ + assert(EBIT_TEST(e->flag, ENTRY_FWD_HDR_WAIT)); + EBIT_CLR(e->flag, ENTRY_FWD_HDR_WAIT); +#endif /* PPNR_WIP */ } /* diff --git a/src/store_client.cc b/src/store_client.cc index 9cf7e75b4f..dbf91e165a 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -1,6 +1,6 @@ /* - * $Id: store_client.cc,v 1.37 1998/08/18 22:42:22 wessels Exp $ + * $Id: store_client.cc,v 1.38 1998/08/19 06:05:56 wessels Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -172,6 +172,10 @@ storeClientCopy2(StoreEntry * e, store_client * sc) size_t sz; if (sc->flags.copy_event_pending) return; +#ifdef PPNR_WIP + if (EBIT_TEST(e->flag, ENTRY_FWD_HDR_WAIT)) + return; +#endif /* PPNR_WIP */ if (sc->flags.store_copying) { sc->flags.copy_event_pending = 1; debug(20, 3) ("storeClientCopy2: Queueing storeClientCopyEvent()\n");