From: wessels <> Date: Tue, 13 Aug 1996 05:37:21 +0000 (+0000) Subject: merge with SQUID_1_0_6 X-Git-Tag: SQUID_3_0_PRE1~5973 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a5b9b32532321c967821a827f56664ed062fc39;p=thirdparty%2Fsquid.git merge with SQUID_1_0_6 --- diff --git a/ChangeLog b/ChangeLog index 578ca366ca..f9c1e6d2c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ Changes to squid-1.1.alpha8: - Fixed "tty input" bug where a reverse lookup request was written to stdout. - Cleaned up pointers in protoUnregister(). + - Includes all squid-1.0 changes up to squid-1.0.6. Changes to squid-1.1.alpha7: diff --git a/configure b/configure index 11de7756c1..3a9e485fef 100755 --- a/configure +++ b/configure @@ -517,7 +517,7 @@ fi -# From configure.in Revision: 1.23 +# From configure.in Revision: 1.24 ac_aux_dir= for ac_dir in aux $srcdir/aux; do if test -f $ac_dir/install-sh; then @@ -2234,6 +2234,8 @@ main() { i = _NFILE; #else while((j=open("/dev/null", 0)) > 0) i=j; + close(i); close(i-1); + i++; #endif fprintf (fopen("conftestval", "w"), "%d\n", i); exit(0); @@ -2259,7 +2261,7 @@ if test "$cross_compiling" = yes; then SQUID_UDP_SO_SNDBUF=8192 else cat > conftest.$ac_ext < @@ -2295,7 +2297,7 @@ if test "$cross_compiling" = yes; then SQUID_UDP_SO_RCVBUF=8192 else cat > conftest.$ac_ext < @@ -2331,7 +2333,7 @@ if test "$cross_compiling" = yes; then SQUID_TCP_SO_SNDBUF=8192 else cat > conftest.$ac_ext < @@ -2367,7 +2369,7 @@ if test "$cross_compiling" = yes; then SQUID_TCP_SO_RCVBUF=8192 else cat > conftest.$ac_ext < @@ -2400,7 +2402,7 @@ EOF echo $ac_n "checking if sys_errlist is already defined""... $ac_c" 1>&6 cat > conftest.$ac_ext < int main() { return 0; } diff --git a/configure.in b/configure.in index be5224289c..5899003789 100644 --- a/configure.in +++ b/configure.in @@ -3,13 +3,13 @@ dnl Configuration input file for Squid dnl dnl Duane Wessels, wessels@nlanr.net, February 1996 (autoconf v2.9) dnl -dnl $Id: configure.in,v 1.24 1996/07/20 03:39:39 wessels Exp $ +dnl $Id: configure.in,v 1.25 1996/08/12 23:37:21 wessels Exp $ dnl dnl dnl AC_INIT(src/main.c) AC_CONFIG_HEADER(include/autoconf.h) -AC_REVISION($Revision: 1.24 $)dnl +AC_REVISION($Revision: 1.25 $)dnl AC_PREFIX_DEFAULT(/usr/local/squid) AC_CONFIG_AUX_DIR(aux) @@ -324,6 +324,8 @@ main() { i = _NFILE; #else while((j=open("/dev/null", 0)) > 0) i=j; + close(i); close(i-1); + i++; #endif fprintf (fopen("conftestval", "w"), "%d\n", i); exit(0); diff --git a/src/comm.cc b/src/comm.cc index d87ea9e70e..b340bb2ad7 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,7 +1,6 @@ - /* - * $Id: comm.cc,v 1.51 1996/08/12 23:22:33 wessels Exp $ + * $Id: comm.cc,v 1.52 1996/08/12 23:37:22 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -828,7 +827,7 @@ int comm_select(sec, failtime) void comm_set_select_handler(fd, type, handler, client_data) int fd; unsigned int type; - int (*handler) (); + PF handler; void *client_data; { comm_set_select_handler_plus_timeout(fd, type, handler, client_data, 0); @@ -837,7 +836,7 @@ void comm_set_select_handler(fd, type, handler, client_data) void comm_set_select_handler_plus_timeout(fd, type, handler, client_data, timeout) int fd; unsigned int type; - int (*handler) (); + PF handler; void *client_data; time_t timeout; { @@ -899,7 +898,7 @@ int comm_get_select_handler(fd, type, handler_ptr, client_data_ptr) void comm_add_close_handler(fd, handler, data) int fd; - int (*handler) (); + PF handler; void *data; { struct close_handler *new = xmalloc(sizeof(*new)); @@ -914,7 +913,7 @@ void comm_add_close_handler(fd, handler, data) void comm_remove_close_handler(fd, handler, data) int fd; - int (*handler) (); + PF handler; void *data; { struct close_handler *p, *last = NULL; diff --git a/src/main.cc b/src/main.cc index 2798330761..e75c195feb 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,5 +1,5 @@ /* - * $Id: main.cc,v 1.57 1996/07/27 07:07:43 wessels Exp $ + * $Id: main.cc,v 1.58 1996/08/12 23:37:24 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -423,7 +423,6 @@ static void mainInitialize() if (first_time) { stmemInit(); /* stmem must go before at least redirect */ disk_init(); /* disk_init must go before ipcache_init() */ - writePidFile(); /* write PID file */ } ipcache_init(); fqdncache_init(); @@ -437,7 +436,6 @@ static void mainInitialize() #endif if (first_time) { - first_time = 0; /* module initialization */ urlInitialize(); stat_init(&CacheInfo, Config.Log.access); @@ -458,12 +456,16 @@ static void mainInitialize() if (theOutIcpConnection >= 0 && (!httpd_accel_mode || Config.Accel.withProxy)) neighbors_open(theOutIcpConnection); + if (first_time) + writePidFile(); /* write PID file */ + squid_signal(SIGUSR1, rotate_logs, SA_RESTART); squid_signal(SIGUSR2, sigusr2_handle, SA_RESTART); squid_signal(SIGHUP, reconfigure, SA_RESTART); squid_signal(SIGTERM, shut_down, SA_NODEFER | SA_RESETHAND | SA_RESTART); squid_signal(SIGINT, shut_down, SA_NODEFER | SA_RESETHAND | SA_RESTART); debug(1, 0, "Ready to serve requests.\n"); + first_time = 0; } diff --git a/src/store.cc b/src/store.cc index 04c5902154..2ea207170e 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,5 +1,5 @@ /* - * $Id: store.cc,v 1.78 1996/08/12 23:22:38 wessels Exp $ + * $Id: store.cc,v 1.79 1996/08/12 23:37:25 wessels Exp $ * * DEBUG: section 20 Storeage Manager * AUTHOR: Harvest Derived @@ -1824,8 +1824,11 @@ int storeWalkThrough(proc, data) int n = 0; for (e = storeGetFirst(); e; e = storeGetNext()) { - if ((++n & 0xFF) == 0) + if ((++n & 0xFF) == 0) { getCurrentTime(); + if (shutdown_pending || reread_pending) + break; + } if ((n & 0xFFF) == 0) debug(20, 2, "storeWalkThrough: %7d objects so far.\n", n); count += proc(e, data); diff --git a/src/url.cc b/src/url.cc index ded138f28c..12aebe6b88 100644 --- a/src/url.cc +++ b/src/url.cc @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.28 1996/08/12 23:22:39 wessels Exp $ + * $Id: url.cc,v 1.29 1996/08/12 23:37:25 wessels Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -199,6 +199,10 @@ request_t *urlParse(method, url) protocol_t protocol = PROTO_NONE; proto[0] = host[0] = urlpath[0] = login[0] = '\0'; + if (strlen(url) > MAX_URL) { + debug(23, 0, "urlParse: URL too large (%d bytes)\n", strlen(url)); + return NULL; + } if (method == METHOD_CONNECT) { port = CONNECT_PORT; if (sscanf(url, "%[^:]:%d", host, &port) < 1)