From: wessels <> Date: Wed, 18 Jun 1997 07:43:42 +0000 (+0000) Subject: more cbdata additions X-Git-Tag: SQUID_3_0_PRE1~4932 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7dd4488501c54dda7ffa695c8d896ee9eb495ceb;p=thirdparty%2Fsquid.git more cbdata additions --- diff --git a/src/comm.cc b/src/comm.cc index 8a7c63659d..b4efd9f958 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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()); diff --git a/src/ftp.cc b/src/ftp.cc index b032ef587f..e64277ab8b 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -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; diff --git a/src/gopher.cc b/src/gopher.cc index 5caf0da636..b7fb7d9f42 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -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); } diff --git a/src/http.cc b/src/http.cc index d6c612629d..684550b0fb 100644 --- a/src/http.cc +++ b/src/http.cc @@ -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; diff --git a/src/ssl.cc b/src/ssl.cc index 5676138257..03685b5a44 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -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; diff --git a/src/tunnel.cc b/src/tunnel.cc index 4417d5253c..f44d0e9ca9 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -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; diff --git a/src/wais.cc b/src/wais.cc index a8cc288f3f..20cd27c83e 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -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;