]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Move pumpRestart check from http.c to forward.c
authorwessels <>
Mon, 29 Jun 1998 21:22:50 +0000 (21:22 +0000)
committerwessels <>
Mon, 29 Jun 1998 21:22:50 +0000 (21:22 +0000)
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
src/http.cc

index fe7af409b590ee2480d591cd403a4ef689e1134a..c28356b4a71d9475a13f0194ce7d8fc1f859d3bf 100644 (file)
@@ -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;
 }
 
index b57d08ceb1b5c29693afe83cfaafed193425b894..91ffb01a13ec9d6a3311d0686290e7ca60765fb4 100644 (file)
@@ -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)
 {