]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed handling of pconns. fwdUnregister no longer frees
authorwessels <>
Sat, 12 Dec 1998 06:10:47 +0000 (06:10 +0000)
committerwessels <>
Sat, 12 Dec 1998 06:10:47 +0000 (06:10 +0000)
the fwdState.

src/forward.cc
src/http.cc

index 5c7ce82e8124c3a4bbcafb39c092e3b36f8a8785..0f6d6ccfd61f4758080e528779e8f653e0071403 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: forward.cc,v 1.33 1998/12/05 00:54:23 wessels Exp $
+ * $Id: forward.cc,v 1.34 1998/12/11 23:10:48 wessels Exp $
  *
  * DEBUG: section 17    Request Forwarding
  * AUTHOR: Duane Wessels
@@ -72,6 +72,7 @@ fwdStateFree(FwdState * fwdState)
     ErrorState *err;
     int sfd;
     static int loop_detect = 0;
+    debug(17,3)("fwdStateFree: %p\n", fwdState);
     assert(loop_detect++ == 0);
     assert(e->mem_obj);
     if (e->store_status == STORE_PENDING) {
@@ -466,7 +467,6 @@ fwdUnregister(int fd, FwdState * fwdState)
     assert(fd = fwdState->server_fd);
     comm_remove_close_handler(fd, fwdServerClosed, fwdState);
     fwdState->server_fd = -1;
-    fwdStateFree(fwdState);
 }
 
 /*
@@ -480,7 +480,7 @@ fwdComplete(FwdState * fwdState)
 {
     StoreEntry *e = fwdState->entry;
     assert(e->store_status == STORE_PENDING);
-    debug(17, 3) ("fwdComplete: %s\n\tstatus %d", storeUrl(e),
+    debug(17, 3) ("fwdComplete: %s\n\tstatus %d\n", storeUrl(e),
        e->mem_obj->reply->sline.status);
     if (!EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT)) {
        debug(17, 3) ("ENTRY_FWD_HDR_WAIT not set, calling storeComplete\n");
@@ -489,11 +489,8 @@ fwdComplete(FwdState * fwdState)
 debug(0,0)("fwdComplete: re-forwarding %d %s\n", 
        e->mem_obj->reply->sline.status,
        storeUrl(e));
-       assert(fwdState->server_fd > -1);
-       /* XXX this breaks pconn */
-       comm_remove_close_handler(fwdState->server_fd,
-           fwdServerClosed, fwdState);
-       fwdState->server_fd = -1;
+       if (fwdState->server_fd > -1)
+               fwdUnregister(fwdState->server_fd, fwdState);
        storeEntryReset(e);
        fwdStartComplete(fwdState->servers, fwdState);
     } else {
index d6bc131ec01187dc17a78933b01c5cba80ddb0d9..d7fa31f1a0e39c40d88ef4884a907e1c7b8c83a5 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: http.cc,v 1.333 1998/12/05 00:54:28 wessels Exp $
+ * $Id: http.cc,v 1.334 1998/12/11 23:10:47 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -522,11 +522,9 @@ httpReadReply(int fd, void *data)
            commSetTimeout(fd, -1, NULL, NULL);
            commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0);
            comm_remove_close_handler(fd, httpStateFree, httpState);
-           fwdComplete(httpState->fwd);
-           /* call fwdComplete BEFORE fwdUnregister or else fwdUnregister
-            * will storeAbort */
            fwdUnregister(fd, httpState->fwd);
            pconnPush(fd, request->host, request->port);
+           fwdComplete(httpState->fwd);
            httpState->fd = -1;
            httpStateFree(-1, httpState);
        } else {