From 1d22e062024d3eb85778a73ea227c6f745787676 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Mon, 29 Jun 1998 21:22:50 +0000 Subject: [PATCH] Move pumpRestart check from http.c to forward.c Removed unused httpRestart() and httpTryRestart() removed storeUnregister/storeClientListAdd calls for pump requests because we need the pump code to stay attached to the client in case we need to re-forward the request. --- src/forward.cc | 5 ++++- src/http.cc | 49 +------------------------------------------------ 2 files changed, 5 insertions(+), 49 deletions(-) diff --git a/src/forward.cc b/src/forward.cc index fe7af409b5..c28356b4a7 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.13 1998/06/28 16:18:21 wessels Exp $ + * $Id: forward.cc,v 1.14 1998/06/29 15:22:50 wessels Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -97,6 +97,9 @@ fwdCheckRetry(FwdState * fwdState) return 0; if (squid_curtime - fwdState->start > 120) return 0; + if (pumpMethod(fwdState->request->method)) + if (0 == pumpRestart(fwdState->request)) + return 0; return 1; } diff --git a/src/http.cc b/src/http.cc index b57d08ceb1..91ffb01a13 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.288 1998/06/28 02:01:44 wessels Exp $ + * $Id: http.cc,v 1.289 1998/06/29 15:22:51 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -128,8 +128,6 @@ static void httpCacheNegatively(StoreEntry *); static void httpMakePrivate(StoreEntry *); static void httpMakePublic(StoreEntry *); static int httpSocketOpen(StoreEntry *, request_t *); -static void httpRestart(HttpStateData *); -static int httpTryRestart(HttpStateData *); static int httpCachableReply(HttpStateData *); static void @@ -856,51 +854,6 @@ httpStart(FwdState * fwdState, int fd) httpConnectDone(fd, COMM_OK, httpState); } -static int -httpTryRestart(HttpStateData * httpState) -{ - /* - * We only retry the request if it looks like it was - * on a persistent/pipelined connection - */ - if (fd_table[httpState->fd].uses < 2) - return 0; - if (pumpMethod(httpState->orig_request->method)) - if (0 == pumpRestart(httpState->orig_request)) - return 0; - return 1; -} - -static void -httpRestart(HttpStateData * httpState) -{ - /* restart a botched request from a persistent connection */ - debug(11, 2) ("Retrying HTTP request for %s\n", storeUrl(httpState->entry)); - if (pumpMethod(httpState->orig_request->method)) { - debug(11, 3) ("Potential Coredump: httpRestart %s %s\n", - RequestMethodStr[httpState->orig_request->method], - storeUrl(httpState->entry)); - } - if (httpState->fd >= 0) { - comm_remove_close_handler(httpState->fd, httpStateFree, httpState); - comm_close(httpState->fd); - httpState->fd = -1; - } - httpState->fd = httpSocketOpen(httpState->entry, httpState->orig_request); - if (httpState->fd < 0) - return; - comm_add_close_handler(httpState->fd, httpStateFree, httpState); - commSetTimeout(httpState->fd, - Config.Timeout.connect, - httpTimeout, - httpState); - commConnectStart(httpState->fd, - httpState->request->host, - httpState->request->port, - httpConnectDone, - httpState); -} - static void httpConnectDone(int fd, int status, void *data) { -- 2.47.3