]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
more cbdata additions
authorwessels <>
Wed, 18 Jun 1997 07:43:42 +0000 (07:43 +0000)
committerwessels <>
Wed, 18 Jun 1997 07:43:42 +0000 (07:43 +0000)
src/comm.cc
src/ftp.cc
src/gopher.cc
src/http.cc
src/ssl.cc
src/tunnel.cc
src/wais.cc

index 8a7c63659d3c25f645d0c7bd613ec176fbb7d92c..b4efd9f958d8c9be87dbfe403067e5d86c005cc0 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm.cc,v 1.164 1997/06/18 00:19:52 wessels Exp $
+ * $Id: comm.cc,v 1.165 1997/06/18 01:43:42 wessels Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -386,6 +386,8 @@ commRetryConnect(int fd, ConnectStateData * cs)
     int fd2;
     if (++cs->tries == 4)
        return 0;
+    if (!cbdataValid(cs->data))
+       return 0;
     fd2 = socket(AF_INET, SOCK_STREAM, 0);
     if (fd2 < 0) {
        debug(5, 0) ("commRetryConnect: socket: %s\n", xstrerror());
index b032ef587f8acef27c4c56122f05ea5538d3c55a..e64277ab8b7a61a68b7240405ecd6479d50431ac 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ftp.cc,v 1.122 1997/06/16 22:01:45 wessels Exp $
+ * $Id: ftp.cc,v 1.123 1997/06/18 01:43:42 wessels Exp $
  *
  * DEBUG: section 9     File Transfer Protocol (FTP)
  * AUTHOR: Harvest Derived
@@ -200,7 +200,7 @@ ftpStateFree(int fd, void *data)
     safe_free(ftpState->ctrl.last_message);
     safe_free(ftpState->title_url);
     safe_free(ftpState->filepath);
-    xfree(ftpState);
+    cbdataFree(ftpState);
 }
 
 static void
@@ -816,6 +816,7 @@ ftpStart(request_t * request, StoreEntry * entry)
     FtpStateData *ftpState = xcalloc(1, sizeof(FtpStateData));
     char *response;
     int fd;
+    cbdataAdd(ftpState);
     debug(9, 3) ("FtpStart: '%s'\n", entry->url);
     storeLockObject(entry);
     ftpState->entry = entry;
index 5caf0da636afa8d6e4281c1b8d3929e968c7dc6d..b7fb7d9f423e6e294f70485c5f8325a1710d8faa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: gopher.cc,v 1.84 1997/06/04 06:15:56 wessels Exp $
+ * $Id: gopher.cc,v 1.85 1997/06/18 01:43:43 wessels Exp $
  *
  * DEBUG: section 10    Gopher
  * AUTHOR: Harvest Derived
@@ -195,7 +195,8 @@ gopherStateFree(int fd, void *data)
        storeUnlockObject(gopherState->entry);
     }
     put_free_4k_page(gopherState->buf);
-    xfree(gopherState);
+    gopherState->buf = NULL;
+    cbdataFree(gopherState);
 }
 
 
@@ -933,6 +934,7 @@ static GopherStateData *
 CreateGopherStateData(void)
 {
     GopherStateData *gd = xcalloc(1, sizeof(GopherStateData));
+    cbdataAdd(gd);
     gd->buf = get_free_4k_page();
     return (gd);
 }
index d6c612629d4ba0f196a96fbc30e71bdd88ff2206..684550b0fb64780425450a9e4a3c9a57185f8fe8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: http.cc,v 1.171 1997/06/18 00:19:53 wessels Exp $
+ * $Id: http.cc,v 1.172 1997/06/18 01:43:44 wessels Exp $
  *
  * DEBUG: section 11    Hypertext Transfer Protocol (HTTP)
  * AUTHOR: Harvest Derived
@@ -224,7 +224,9 @@ httpStateFree(int fd, void *data)
     }
     requestUnlink(httpState->request);
     requestUnlink(httpState->orig_request);
-    xfree(httpState);
+    httpState->request = NULL;
+    httpState->orig_request = NULL;
+    cbdataFree(httpState);
 }
 
 int
@@ -853,6 +855,7 @@ proxyhttpStart(request_t * orig_request,
     }
     storeLockObject(entry);
     httpState = xcalloc(1, sizeof(HttpStateData));
+    cbdataAdd(httpState);
     httpState->entry = entry;
     request = get_free_request_t();
     httpState->request = requestLink(request);
@@ -921,6 +924,7 @@ httpStart(request_t * request, StoreEntry * entry)
     }
     storeLockObject(entry);
     httpState = xcalloc(1, sizeof(HttpStateData));
+    cbdataAdd(httpState);
     httpState->entry = entry;
     httpState->request = requestLink(request);
     httpState->fd = fd;
index 56761382574936d51404d6f9c46e301e1226e1c0..03685b5a4486e6745a776d8273856d4a50eeddd3 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: ssl.cc,v 1.54 1997/06/04 06:16:09 wessels Exp $
+ * $Id: ssl.cc,v 1.55 1997/06/18 01:43:45 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -112,7 +112,8 @@ sslStateFree(int fd, void *data)
     safe_free(sslState->client.buf);
     xfree(sslState->url);
     requestUnlink(sslState->request);
-    safe_free(sslState);
+    sslState->request = NULL;
+    cbdataFree(sslState);
 }
 
 /* Read from server side and queue it for writing to the client */
@@ -388,6 +389,7 @@ sslStart(int fd, const char *url, request_t * request, int *size_ptr)
        return;
     }
     sslState = xcalloc(1, sizeof(SslStateData));
+    cbdataAdd(sslState);
     sslState->url = xstrdup(url);
     sslState->request = requestLink(request);
     sslState->timeout = Config.Timeout.read;
index 4417d5253cb6305238e82c16051820e0cf27ea97..f44d0e9ca9b304c6ffbcfa2b4ca0b2a9d80537ea 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: tunnel.cc,v 1.54 1997/06/04 06:16:09 wessels Exp $
+ * $Id: tunnel.cc,v 1.55 1997/06/18 01:43:45 wessels Exp $
  *
  * DEBUG: section 26    Secure Sockets Layer Proxy
  * AUTHOR: Duane Wessels
@@ -112,7 +112,8 @@ sslStateFree(int fd, void *data)
     safe_free(sslState->client.buf);
     xfree(sslState->url);
     requestUnlink(sslState->request);
-    safe_free(sslState);
+    sslState->request = NULL;
+    cbdataFree(sslState);
 }
 
 /* Read from server side and queue it for writing to the client */
@@ -388,6 +389,7 @@ sslStart(int fd, const char *url, request_t * request, int *size_ptr)
        return;
     }
     sslState = xcalloc(1, sizeof(SslStateData));
+    cbdataAdd(sslState);
     sslState->url = xstrdup(url);
     sslState->request = requestLink(request);
     sslState->timeout = Config.Timeout.read;
index a8cc288f3fd2f58f2d56a1b876d7d6db471c2de2..20cd27c83ea5cd3b093f478a856b7b6bd1989b3e 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: wais.cc,v 1.76 1997/06/04 06:16:17 wessels Exp $
+ * $Id: wais.cc,v 1.77 1997/06/18 01:43:46 wessels Exp $
  *
  * DEBUG: section 24    WAIS Relay
  * AUTHOR: Harvest Derived
@@ -134,7 +134,7 @@ waisStateFree(int fd, void *data)
        return;
     storeUnregisterAbort(waisState->entry);
     storeUnlockObject(waisState->entry);
-    xfree(waisState);
+    cbdataFree(waisState);
 }
 
 /* This will be called when socket lifetime is expired. */
@@ -320,6 +320,7 @@ waisStart(request_t * request, StoreEntry * entry)
        return;
     }
     waisState = xcalloc(1, sizeof(WaisStateData));
+    cbdataAdd(waisState);
     waisState->method = method;
     waisState->relayhost = Config.Wais.relayHost;
     waisState->relayport = Config.Wais.relayPort;