From: wessels <> Date: Thu, 20 May 1999 01:57:34 +0000 (+0000) Subject: 2.2 branch merge X-Git-Tag: SQUID_3_0_PRE1~2202 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1ecaa0a078e4650b30bb709b7285f8bbfbf695db;p=thirdparty%2Fsquid.git 2.2 branch merge --- diff --git a/src/acl.cc b/src/acl.cc index 1f3e5dec35..20b77d5fd9 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.203 1999/05/04 17:40:09 wessels Exp $ + * $Id: acl.cc,v 1.204 1999/05/19 19:57:34 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -1353,7 +1353,9 @@ aclMatchAcl(acl * ae, aclCheck_t * checklist) return aclMatchRegex(ae->data, checklist->browser); /* NOTREACHED */ case ACL_PROXY_AUTH: - if (!r->flags.accelerated) { + if (NULL == r) { + return -1; + } else if (!r->flags.accelerated) { /* Proxy authorization on proxy requests */ header = httpHeaderGetStr(&checklist->request->header, HDR_PROXY_AUTHORIZATION); diff --git a/src/cf.data.pre b/src/cf.data.pre index b4f847f820..83a99d0175 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.154 1999/05/12 16:35:57 wessels Exp $ +# $Id: cf.data.pre,v 1.155 1999/05/19 19:57:36 wessels Exp $ # # # SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -2514,7 +2514,7 @@ DOC_END NAME: snmp_incoming_address TYPE: address -LOC: Config.Addrs.snmp_outgoing +LOC: Config.Addrs.snmp_incoming DEFAULT: 0.0.0.0 IFDEF: SQUID_SNMP DOC_NONE diff --git a/src/client_side.cc b/src/client_side.cc index bceb23e6ee..355d8d1c2d 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.455 1999/05/11 18:51:47 wessels Exp $ + * $Id: client_side.cc,v 1.456 1999/05/19 19:57:39 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -1336,6 +1336,7 @@ clientCacheHit(void *data, char *buf, ssize_t size) debug(33, 4) ("clientCacheHit: Reply code %d != 200\n", mem->reply->sline.status); memFree(buf, MEM_CLIENT_SOCK_BUF); + http->log_type = LOG_TCP_MISS; clientProcessMiss(http); } else if (modifiedSince(e, http->request)) { http->log_type = LOG_TCP_IMS_HIT; diff --git a/src/delay_pools.cc b/src/delay_pools.cc index 5dfd9a3b00..6a6ded583a 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.cc,v 1.9 1999/05/04 21:58:20 wessels Exp $ + * $Id: delay_pools.cc,v 1.10 1999/05/19 19:57:41 wessels Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: David Luyer @@ -165,6 +165,8 @@ delayRegisterDelayIdPtr(delay_id * loc) hash_link *lnk; if (!delay_id_ptr_hash) return; + if (*loc == 0) + return; lnk = xmalloc(sizeof(hash_link)); lnk->key = (char *) loc; hash_join(delay_id_ptr_hash, lnk); @@ -627,6 +629,7 @@ delaySetStoreClient(StoreEntry * e, void *data, delay_id delay_id) store_client *sc = storeClientListSearch(e->mem_obj, data); assert(sc != NULL); sc->delay_id = delay_id; + delayRegisterDelayIdPtr(&sc->delay_id); } static void diff --git a/src/enums.h b/src/enums.h index 36d6297cdf..b16b64be86 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.151 1999/05/10 19:33:23 wessels Exp $ + * $Id: enums.h,v 1.152 1999/05/19 19:57:42 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -335,7 +335,6 @@ enum { enum { PING_NONE, PING_WAITING, - PING_TIMEOUT, PING_DONE }; diff --git a/src/forward.cc b/src/forward.cc index fde59897cf..705d294aac 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.59 1999/05/04 20:58:31 wessels Exp $ + * $Id: forward.cc,v 1.60 1999/05/19 19:57:43 wessels Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -462,10 +462,12 @@ fwdCheckDeferRead(int fd, void *data) if (mem == NULL) return 0; #if DELAY_POOLS - if (fd > -1) - if (!delayIsNoDelay(fd)) - if (delayMostBytesWanted(mem, 1) == 0) - return 1; + if (fd < 0) + (void) 0; + else if (delayIsNoDelay(fd)) + (void) 0; + else if (delayMostBytesWanted(mem, 1) == 0) + return 1; #endif if (EBIT_TEST(e->flags, ENTRY_FWD_HDR_WAIT)) return 0; diff --git a/src/ftp.cc b/src/ftp.cc index 37c6a389e3..e1ca9eca5e 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.284 1999/05/11 20:14:14 wessels Exp $ + * $Id: ftp.cc,v 1.285 1999/05/19 19:57:45 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -60,24 +60,24 @@ typedef enum { } ftp_state_t; struct _ftp_flags { - int isdir:1; - int pasv_supported:1; - int skip_whitespace:1; - int rest_supported:1; - int pasv_only:1; - int authenticated:1; - int http_header_sent:1; - int tried_nlst:1; - int use_base:1; - int root_dir:1; - int no_dotdot:1; - int html_header_sent:1; - int binary:1; - int try_slash_hack:1; - int put:1; - int put_mkdir:1; - int listformat_unknown:1; - int datachannel_hack:1; + unsigned int isdir:1; + unsigned int pasv_supported:1; + unsigned int skip_whitespace:1; + unsigned int rest_supported:1; + unsigned int pasv_only:1; + unsigned int authenticated:1; + unsigned int http_header_sent:1; + unsigned int tried_nlst:1; + unsigned int use_base:1; + unsigned int root_dir:1; + unsigned int no_dotdot:1; + unsigned int html_header_sent:1; + unsigned int binary:1; + unsigned int try_slash_hack:1; + unsigned int put:1; + unsigned int put_mkdir:1; + unsigned int listformat_unknown:1; + unsigned int datachannel_hack:1; }; typedef struct _Ftpdata { @@ -265,13 +265,23 @@ ftpStateFree(int fdnotused, void *data) storeUnlockObject(ftpState->entry); if (ftpState->reply_hdr) { memFree(ftpState->reply_hdr, MEM_8K_BUF); + /* this seems unnecessary, but people report SEGV's + * when freeing memory in this function */ ftpState->reply_hdr = NULL; } requestUnlink(ftpState->request); - if (ftpState->ctrl.buf) + if (ftpState->ctrl.buf) { ftpState->ctrl.freefunc(ftpState->ctrl.buf); - if (ftpState->data.buf) + /* this seems unnecessary, but people report SEGV's + * when freeing memory in this function */ + ftpState->ctrl.buf = NULL; + } + if (ftpState->data.buf) { ftpState->data.freefunc(ftpState->data.buf); + /* this seems unnecessary, but people report SEGV's + * when freeing memory in this function */ + ftpState->data.buf = NULL; + } if (ftpState->pathcomps) wordlistDestroy(&ftpState->pathcomps); if (ftpState->ctrl.message) diff --git a/src/main.cc b/src/main.cc index c019ace8ed..e6b9964614 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.298 1999/05/04 21:58:25 wessels Exp $ + * $Id: main.cc,v 1.299 1999/05/19 19:57:47 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -724,7 +724,9 @@ watch_child(char *argv[]) #endif for (i = 0; i < Squid_MaxFD; i++) close(i); +#if NOT_NEEDED umask(0); +#endif for (;;) { if ((pid = fork()) == 0) { /* child */ diff --git a/src/peer_select.cc b/src/peer_select.cc index 6707cb20df..6a6386fa5b 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -1,6 +1,6 @@ /* - * $Id: peer_select.cc,v 1.99 1999/04/23 02:57:28 wessels Exp $ + * $Id: peer_select.cc,v 1.100 1999/05/19 19:57:49 wessels Exp $ * * DEBUG: section 44 Peer Selection Algorithm * AUTHOR: Duane Wessels @@ -444,9 +444,9 @@ peerPingTimeout(void *data) StoreEntry *entry = psstate->entry; if (entry) debug(44, 3) ("peerPingTimeout: '%s'\n", storeUrl(entry)); - entry->ping_status = PING_TIMEOUT; if (!cbdataValid(psstate->callback_data)) { /* request aborted */ + entry->ping_status = PING_DONE; cbdataUnlock(psstate->callback_data); peerSelectStateFree(psstate); return; diff --git a/src/ssl.cc b/src/ssl.cc index a23bd8dba9..ae11bd9077 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -1,6 +1,6 @@ /* - * $Id: ssl.cc,v 1.95 1999/05/04 21:58:37 wessels Exp $ + * $Id: ssl.cc,v 1.96 1999/05/19 19:57:50 wessels Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -529,8 +529,10 @@ sslPeerSelectComplete(FwdServer * fs, void *data) } #if DELAY_POOLS /* no point using the delayIsNoDelay stuff since ssl is nice and simple */ - if (g && g->options.no_delay) + if (g && g->options.no_delay && sslState->delay_id) { + delayUnregisterDelayIdPtr(&sslState->delay_id); sslState->delay_id = 0; + } #endif commConnectStart(sslState->server.fd, sslState->host, diff --git a/src/store.cc b/src/store.cc index d3afcb9e50..e8e64f2671 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.498 1999/05/04 21:58:40 wessels Exp $ + * $Id: store.cc,v 1.499 1999/05/19 19:57:53 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -49,7 +49,6 @@ const char *pingStatusStr[] = { "PING_NONE", "PING_WAITING", - "PING_TIMEOUT", "PING_DONE" }; diff --git a/src/store_client.cc b/src/store_client.cc index b6f61921b8..655fa153d0 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -1,6 +1,6 @@ /* - * $Id: store_client.cc,v 1.67 1999/05/04 21:58:42 wessels Exp $ + * $Id: store_client.cc,v 1.68 1999/05/19 19:57:54 wessels Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -132,7 +132,6 @@ storeClientListAdd(StoreEntry * e, void *data) *T = sc; #if DELAY_POOLS sc->delay_id = 0; - delayRegisterDelayIdPtr(&sc->delay_id); #endif } diff --git a/src/tools.cc b/src/tools.cc index fb5f59a89f..06f1184081 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.178 1999/05/04 21:58:45 wessels Exp $ + * $Id: tools.cc,v 1.179 1999/05/19 19:57:56 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -807,6 +807,8 @@ gb_to_str(const gb_t * g) static int call_id = 0; double value = gb_to_double(g); char *buf = bufs[call_id++]; + if (call_id >= max_cc_calls) + call_id = 0; /* select format */ if (value < 1e9) snprintf(buf, sizeof(GbBuf), "%.2f MB", value / 1e6); diff --git a/src/tunnel.cc b/src/tunnel.cc index 70a32be65b..c30077f29c 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.95 1999/05/04 21:58:37 wessels Exp $ + * $Id: tunnel.cc,v 1.96 1999/05/19 19:57:50 wessels Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -529,8 +529,10 @@ sslPeerSelectComplete(FwdServer * fs, void *data) } #if DELAY_POOLS /* no point using the delayIsNoDelay stuff since ssl is nice and simple */ - if (g && g->options.no_delay) + if (g && g->options.no_delay && sslState->delay_id) { + delayUnregisterDelayIdPtr(&sslState->delay_id); sslState->delay_id = 0; + } #endif commConnectStart(sslState->server.fd, sslState->host,