From: wessels <> Date: Sat, 16 Nov 1996 00:26:18 +0000 (+0000) Subject: Remove store_status == STORE_PENDING checks everywhere and just put it X-Git-Tag: SQUID_3_0_PRE1~5455 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ce49f5242aba9b32e083f0b63aca08658ccc66ff;p=thirdparty%2Fsquid.git Remove store_status == STORE_PENDING checks everywhere and just put it in squid_error_entry(); remove the debug_trap crap. --- diff --git a/src/errorpage.cc b/src/errorpage.cc index b55a940096..f2b25d8a5f 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.51 1996/11/07 21:19:18 wessels Exp $ + * $Id: errorpage.cc,v 1.52 1996/11/15 17:26:18 wessels Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -157,14 +157,10 @@ squid_error_entry(StoreEntry * entry, log_type type, const char *msg) { int error_index; - if (!entry) { - debug_trap("squid_error_entry: NULL entry"); + if (entry == NULL) return; - } - if (entry->store_status != STORE_PENDING) { - debug_trap("squid_error_entry: store_status != STORE_PENDING"); + if (entry->store_status != STORE_PENDING) return; - } if (type < ERR_MIN || type > ERR_MAX) fatal_dump("squid_error_entry: type out of range."); error_index = (int) (type - ERR_MIN); diff --git a/src/ftp.cc b/src/ftp.cc index d697d8dfc3..0e16bd0c13 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.83 1996/11/15 07:51:08 wessels Exp $ + * $Id: ftp.cc,v 1.84 1996/11/15 17:26:19 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -188,8 +188,7 @@ ftpLifetimeExpire(int fd, FtpStateData * data) StoreEntry *entry = NULL; entry = data->entry; debug(9, 4, "ftpLifeTimeExpire: FD %d: '%s'\n", fd, entry->url); - if (entry->store_status == STORE_PENDING) - squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); + squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); comm_close(fd); } @@ -409,10 +408,8 @@ ftpSendComplete(int fd, char *buf, int size, int errflag, void *data) buf = NULL; } if (errflag) { - if (entry->store_status == STORE_PENDING) { - squid_error_entry(entry, ERR_CONNECT_FAIL, xstrerror()); - comm_close(fd); - } + squid_error_entry(entry, ERR_CONNECT_FAIL, xstrerror()); + comm_close(fd); return; } commSetSelect(ftpState->ftp_fd, diff --git a/src/gopher.cc b/src/gopher.cc index 9c38d80cfa..ddd602d624 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,5 +1,5 @@ /* - * $Id: gopher.cc,v 1.67 1996/11/15 00:36:18 wessels Exp $ + * $Id: gopher.cc,v 1.68 1996/11/15 17:26:20 wessels Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -695,8 +695,7 @@ gopherLifetimeExpire(int fd, GopherStateData * data) StoreEntry *entry = NULL; entry = data->entry; debug(10, 4, "gopherLifeTimeExpire: FD %d: '%s'\n", fd, entry->url); - if (entry->store_status == STORE_PENDING) - squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); + squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); commSetSelect(fd, COMM_SELECT_READ | COMM_SELECT_WRITE, NULL, diff --git a/src/http.cc b/src/http.cc index 4028683aff..7eec4304e4 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,5 +1,5 @@ /* - * $Id: http.cc,v 1.108 1996/11/15 07:51:09 wessels Exp $ + * $Id: http.cc,v 1.109 1996/11/15 17:26:21 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -211,8 +211,7 @@ httpLifetimeExpire(int fd, void *data) HttpStateData *httpState = data; StoreEntry *entry = httpState->entry; debug(11, 4, "httpLifeTimeExpire: FD %d: '%s'\n", fd, entry->url); - if (entry->store_status == STORE_PENDING) - squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); + squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); commSetSelect(fd, COMM_SELECT_READ | COMM_SELECT_WRITE, NULL, NULL, 0); comm_close(fd); } diff --git a/src/store.cc b/src/store.cc index c79400ef97..e0e537aa6b 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.166 1996/11/15 00:36:23 wessels Exp $ + * $Id: store.cc,v 1.167 1996/11/15 17:26:22 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -2833,7 +2833,7 @@ storeEntryValidToSend(StoreEntry * e) } int -storeFirstClientFD(MemObject *mem) +storeFirstClientFD(MemObject * mem) { int i; if (mem == NULL) diff --git a/src/url.cc b/src/url.cc index e3ab2d70b9..8a2cd6aeb3 100644 --- a/src/url.cc +++ b/src/url.cc @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.42 1996/11/15 00:36:24 wessels Exp $ + * $Id: url.cc,v 1.43 1996/11/15 17:26:23 wessels Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -201,7 +201,7 @@ urlParse(method_t method, char *url) int l; proto[0] = host[0] = urlpath[0] = login[0] = '\0'; - if ((l = strlen(url)) > (MAX_URL-1)) { + if ((l = strlen(url)) > (MAX_URL - 1)) { /* terminate so it doesn't overflow other buffers */ *(url + (MAX_URL >> 1)) = '\0'; debug(23, 0, "urlParse: URL too large (%d bytes)\n", l); diff --git a/src/wais.cc b/src/wais.cc index 5675f2c68d..07e0346638 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -1,6 +1,6 @@ /* - * $Id: wais.cc,v 1.57 1996/11/15 00:36:25 wessels Exp $ + * $Id: wais.cc,v 1.58 1996/11/15 17:26:24 wessels Exp $ * * DEBUG: section 24 WAIS Relay * AUTHOR: Harvest Derived @@ -159,8 +159,7 @@ waisLifetimeExpire(int fd, WaisStateData * waisState) entry = waisState->entry; debug(24, 4, "waisLifeTimeExpire: FD %d: '%s'\n", fd, entry->url); - if (entry->store_status == STORE_PENDING) - squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); + squid_error_entry(entry, ERR_LIFETIME_EXP, NULL); commSetSelect(fd, COMM_SELECT_READ | COMM_SELECT_WRITE, NULL, NULL, 0); comm_close(fd); }