From: wessels <> Date: Mon, 6 Mar 2000 23:23:27 +0000 (+0000) Subject: Merge changes from 2.3 branch. Mostly this is copyright text changes. X-Git-Tag: SQUID_3_0_PRE1~2063 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efd900cbf196caaf8555ce5e7aab26923bd54d99;p=thirdparty%2Fsquid.git Merge changes from 2.3 branch. Mostly this is copyright text changes. --- diff --git a/src/CacheDigest.cc b/src/CacheDigest.cc index c2996836b7..780f531ee7 100644 --- a/src/CacheDigest.cc +++ b/src/CacheDigest.cc @@ -1,6 +1,6 @@ /* - * $Id: CacheDigest.cc,v 1.29 1998/12/05 00:54:08 wessels Exp $ + * $Id: CacheDigest.cc,v 1.30 2000/03/06 16:23:27 wessels Exp $ * * DEBUG: section 70 Cache Digest * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ETag.cc b/src/ETag.cc index 2271aa14d8..686ffb63cb 100644 --- a/src/ETag.cc +++ b/src/ETag.cc @@ -1,6 +1,6 @@ /* - * $Id: ETag.cc,v 1.5 1998/08/13 21:14:39 wessels Exp $ + * $Id: ETag.cc,v 1.6 2000/03/06 16:23:27 wessels Exp $ * * AUTHOR: Alex Rousskov * @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpBody.cc b/src/HttpBody.cc index e3b6c1ecb5..dcbce0b7f0 100644 --- a/src/HttpBody.cc +++ b/src/HttpBody.cc @@ -2,7 +2,7 @@ /* - * $Id: HttpBody.cc,v 1.15 1998/07/22 20:36:42 wessels Exp $ + * $Id: HttpBody.cc,v 1.16 2000/03/06 16:23:27 wessels Exp $ * * DEBUG: section 56 HTTP Message Body * AUTHOR: Alex Rousskov @@ -14,10 +14,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpHdrCc.cc b/src/HttpHdrCc.cc index a09e2d4f01..80e7d99383 100644 --- a/src/HttpHdrCc.cc +++ b/src/HttpHdrCc.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrCc.cc,v 1.19 1999/12/30 17:36:16 wessels Exp $ + * $Id: HttpHdrCc.cc,v 1.20 2000/03/06 16:23:27 wessels Exp $ * * DEBUG: section 65 HTTP Cache Control Header * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpHdrContRange.cc b/src/HttpHdrContRange.cc index 4a0b1ef539..4c4b990b55 100644 --- a/src/HttpHdrContRange.cc +++ b/src/HttpHdrContRange.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrContRange.cc,v 1.11 1999/10/04 05:04:54 wessels Exp $ + * $Id: HttpHdrContRange.cc,v 1.12 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 68 HTTP Content-Range Header * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpHdrExtField.cc b/src/HttpHdrExtField.cc index 52b959536c..0b0dd4eb7f 100644 --- a/src/HttpHdrExtField.cc +++ b/src/HttpHdrExtField.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrExtField.cc,v 1.7 1999/04/15 06:15:40 wessels Exp $ + * $Id: HttpHdrExtField.cc,v 1.8 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 69 HTTP Header: Extension Field * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpHdrRange.cc b/src/HttpHdrRange.cc index 7c173230db..cde1e1cb7a 100644 --- a/src/HttpHdrRange.cc +++ b/src/HttpHdrRange.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHdrRange.cc,v 1.20 1999/10/04 05:04:54 wessels Exp $ + * $Id: HttpHdrRange.cc,v 1.21 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 64 HTTP Range Header * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpHeader.cc b/src/HttpHeader.cc index 6485262005..82867f8b6b 100644 --- a/src/HttpHeader.cc +++ b/src/HttpHeader.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHeader.cc,v 1.65 1999/12/30 17:36:17 wessels Exp $ + * $Id: HttpHeader.cc,v 1.66 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 55 HTTP Header * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -84,6 +84,7 @@ static const HttpHeaderFieldAttrs HeadersAttrs[] = {"Content-MD5", HDR_CONTENT_MD5, ftStr}, /* for now */ {"Content-Range", HDR_CONTENT_RANGE, ftPContRange}, {"Content-Type", HDR_CONTENT_TYPE, ftStr}, + {"Cookie", HDR_COOKIE, ftStr}, {"Date", HDR_DATE, ftDate_1123}, {"ETag", HDR_ETAG, ftETag}, {"Expires", HDR_EXPIRES, ftDate_1123}, @@ -1094,3 +1095,12 @@ httpHeaderIdByNameDef(const char *name, int name_len) Headers = httpHeaderBuildFieldsInfo(HeadersAttrs, HDR_ENUM_END); return httpHeaderIdByName(name, name_len, Headers, HDR_ENUM_END); } + +const char * +httpHeaderNameById(int id) +{ + if (!Headers) + Headers = httpHeaderBuildFieldsInfo(HeadersAttrs, HDR_ENUM_END); + assert(id >= 0 && id < HDR_ENUM_END); + return HeadersAttrs[id].name; +} diff --git a/src/HttpHeaderTools.cc b/src/HttpHeaderTools.cc index 926f50746e..f631ec8d58 100644 --- a/src/HttpHeaderTools.cc +++ b/src/HttpHeaderTools.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpHeaderTools.cc,v 1.26 1999/10/04 05:04:56 wessels Exp $ + * $Id: HttpHeaderTools.cc,v 1.27 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 66 HTTP Header Tools * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpMsg.cc b/src/HttpMsg.cc index 06d35a3520..d7e4f4585f 100644 --- a/src/HttpMsg.cc +++ b/src/HttpMsg.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpMsg.cc,v 1.6 1998/08/18 03:07:05 wessels Exp $ + * $Id: HttpMsg.cc,v 1.7 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 74 HTTP Message * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpReply.cc b/src/HttpReply.cc index 95bdcf2554..89b2c30c00 100644 --- a/src/HttpReply.cc +++ b/src/HttpReply.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpReply.cc,v 1.39 1999/12/30 17:36:17 wessels Exp $ + * $Id: HttpReply.cc,v 1.40 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 58 HTTP Reply (Response) * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpRequest.cc b/src/HttpRequest.cc index d8f501118e..b093cfe25e 100644 --- a/src/HttpRequest.cc +++ b/src/HttpRequest.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpRequest.cc,v 1.25 1999/12/30 17:36:18 wessels Exp $ + * $Id: HttpRequest.cc,v 1.26 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 73 HTTP Request * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/HttpStatusLine.cc b/src/HttpStatusLine.cc index f3af87fb2d..6775b5dacf 100644 --- a/src/HttpStatusLine.cc +++ b/src/HttpStatusLine.cc @@ -1,6 +1,6 @@ /* - * $Id: HttpStatusLine.cc,v 1.18 1999/04/15 06:15:42 wessels Exp $ + * $Id: HttpStatusLine.cc,v 1.19 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 57 HTTP Status-line * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/MemBuf.cc b/src/MemBuf.cc index 95c990353d..2c2d881431 100644 --- a/src/MemBuf.cc +++ b/src/MemBuf.cc @@ -1,5 +1,5 @@ /* - * $Id: MemBuf.cc,v 1.22 1999/01/19 02:24:19 wessels Exp $ + * $Id: MemBuf.cc,v 1.23 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 59 auto-growing Memory Buffer with printf * AUTHOR: Alex Rousskov @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/Packer.cc b/src/Packer.cc index 9621f11bc7..05afc23a7c 100644 --- a/src/Packer.cc +++ b/src/Packer.cc @@ -1,6 +1,6 @@ /* - * $Id: Packer.cc,v 1.11 1999/01/19 02:24:20 wessels Exp $ + * $Id: Packer.cc,v 1.12 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 60 Packer: A uniform interface to store-like modules * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/StatHist.cc b/src/StatHist.cc index 9fc1f1dc47..22e92fb4c6 100644 --- a/src/StatHist.cc +++ b/src/StatHist.cc @@ -1,6 +1,6 @@ /* - * $Id: StatHist.cc,v 1.23 1999/01/19 02:24:20 wessels Exp $ + * $Id: StatHist.cc,v 1.24 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 62 Generic Histogram * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/String.cc b/src/String.cc index ebd9c98248..d7042a6010 100644 --- a/src/String.cc +++ b/src/String.cc @@ -1,6 +1,6 @@ /* - * $Id: String.cc,v 1.7 1998/07/22 20:36:55 wessels Exp $ + * $Id: String.cc,v 1.8 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 67 String * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/access_log.cc b/src/access_log.cc index 50cdd40a17..3950b7d279 100644 --- a/src/access_log.cc +++ b/src/access_log.cc @@ -1,7 +1,7 @@ /* - * $Id: access_log.cc,v 1.53 1999/12/30 17:36:19 wessels Exp $ + * $Id: access_log.cc,v 1.54 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 46 Access Log * AUTHOR: Duane Wessels @@ -13,10 +13,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -63,6 +63,9 @@ const char *log_tags[] = "TCP_MEM_HIT", "TCP_DENIED", "TCP_OFFLINE_HIT", +#if LOG_TCP_REDIRECTS + "TCP_REDIRECT", +#endif "UDP_HIT", "UDP_MISS", "UDP_DENIED", @@ -234,8 +237,21 @@ accessLogOpen(const char *fname) xstrncpy(LogfileName, fname, SQUID_MAXPATHLEN); LogfileFD = file_open(LogfileName, O_WRONLY | O_CREAT); if (LogfileFD == DISK_ERROR) { - debug(50, 0) ("%s: %s\n", LogfileName, xstrerror()); - fatalf("Cannot open %s: %s", LogfileName, xstrerror()); + if (ENOENT == errno) { + fatalf("%s cannot be created, since the\n" + "\tdirectory it is to reside in does not exist." + "\t(%s)\n", LogfileName, xstrerror()); + } else if (EACCES == errno) { + fatalf("cannot create %s:\n" + "\t%s.\n" + "\tThe directory access.log is to reside in needs to be\n" + "\twriteable by the user %s, the cache_effective_user\n" + "\tset in squid.conf.", + LogfileName, xstrerror(), Config.effectiveUser); + } else { + debug(50, 0) ("%s: %s\n", LogfileName, xstrerror()); + fatalf("Cannot open %s: %s", LogfileName, xstrerror()); + } } LogfileStatus = LOG_ENABLE; } diff --git a/src/acl.cc b/src/acl.cc index fa00c04923..6b70f010d8 100644 --- a/src/acl.cc +++ b/src/acl.cc @@ -1,6 +1,6 @@ /* - * $Id: acl.cc,v 1.211 2000/01/14 08:37:03 wessels Exp $ + * $Id: acl.cc,v 1.212 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 28 Access Control * AUTHOR: Duane Wessels @@ -11,11 +11,11 @@ * Squid is the result of efforts by numerous individuals from the * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the - * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * National Science Foundation. Squid is Copyrighted (C) 2000 by + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1372,7 +1372,7 @@ aclMatchAcl(acl * ae, aclCheck_t * checklist) /* NOTREACHED */ case ACL_MAXCONN: k = clientdbEstablished(checklist->src_addr, 0); - return ((k > ((intlist *) ae->data)->i) ? 0 : 1); + return ((k > ((intlist *) ae->data)->i) ? 1 : 0); /* NOTREACHED */ case ACL_URL_PORT: return aclMatchIntegerRange(ae->data, (int) r->port); @@ -2264,7 +2264,9 @@ aclPurgeMethodInUse(acl_access * a) #endif #include #include +#if HAVE_NETINET_IF_ETHER_H #include +#endif /* * Decode an ascii representation (asc) of an ethernet adress, and place diff --git a/src/asn.cc b/src/asn.cc index 07780045e2..6129b7dfdc 100644 --- a/src/asn.cc +++ b/src/asn.cc @@ -1,5 +1,5 @@ /* - * $Id: asn.cc,v 1.58 1999/12/30 17:36:22 wessels Exp $ + * $Id: asn.cc,v 1.59 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 53 AS Number handling * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/authenticate.cc b/src/authenticate.cc index 6bedd785c6..8564e84ff0 100644 --- a/src/authenticate.cc +++ b/src/authenticate.cc @@ -1,6 +1,6 @@ /* - * $Id: authenticate.cc,v 1.11 1999/04/27 22:11:28 wessels Exp $ + * $Id: authenticate.cc,v 1.12 2000/03/06 16:23:28 wessels Exp $ * * DEBUG: section 29 Authenticator * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cache_cf.cc b/src/cache_cf.cc index f459e81697..1b2612066c 100644 --- a/src/cache_cf.cc +++ b/src/cache_cf.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_cf.cc,v 1.336 2000/01/14 08:37:04 wessels Exp $ + * $Id: cache_cf.cc,v 1.337 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 3 Configuration File Parsing * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,8 +55,8 @@ static const char *const B_MBYTES_STR = "MB"; static const char *const B_GBYTES_STR = "GB"; static const char *const list_sep = ", \t\n\r"; - -static int http_header_first = 0; +static int http_header_first; +static int http_header_allowed = 0; static void configDoConfigure(void); static void parse_refreshpattern(refresh_t **); @@ -188,6 +188,7 @@ parseConfigFile(const char *file_name) cfg_filename = token + 1; memset(config_input_line, '\0', BUFSIZ); config_lineno = 0; + http_header_first = 0; while (fgets(config_input_line, BUFSIZ, fp)) { config_lineno++; if ((token = strchr(config_input_line, '\n'))) @@ -236,6 +237,7 @@ configDoConfigure(void) Config.Announce.period = 86400 * 365; /* one year */ Config.onoff.announce = 0; } +#if USE_DNSSERVER if (Config.dnsChildren < 1) fatal("No dnsservers allocated"); if (Config.dnsChildren > DefaultDnsChildrenMax) { @@ -245,6 +247,7 @@ configDoConfigure(void) DefaultDnsChildrenMax); Config.dnsChildren = DefaultDnsChildrenMax; } +#endif if (Config.Program.redirect) { if (Config.redirectChildren < 1) { Config.redirectChildren = 0; @@ -319,7 +322,9 @@ configDoConfigure(void) } #endif requirePathnameExists("MIME Config Table", Config.mimeTablePathname); +#if USE_DNSSERVER requirePathnameExists("cache_dns_program", Config.Program.dnsserver); +#endif requirePathnameExists("unlinkd_program", Config.Program.unlinkd); if (Config.Program.redirect) requirePathnameExists("redirect_program", Config.Program.redirect->key); @@ -711,7 +716,13 @@ parse_delay_pool_access(delayConfig * cfg) static void dump_http_header(StoreEntry * entry, const char *name, HttpHeaderMask header) { - storeAppendPrintf(entry, "%s\n", name); + int i; + for (i = 0; i < HDR_OTHER; i++) { + if (http_header_allowed && !CBIT_TEST(header, i)) + storeAppendPrintf(entry, "%s allow %s\n", name, httpHeaderNameById(i)); + else if (!http_header_allowed && CBIT_TEST(header, i)) + storeAppendPrintf(entry, "%s deny %s\n", name, httpHeaderNameById(i)); + } } static void @@ -719,7 +730,6 @@ parse_http_header(HttpHeaderMask * header) { int allowed, id; char *t = NULL; - if ((t = strtok(NULL, w_space)) == NULL) { debug(3, 0) ("%s line %d: %s\n", cfg_filename, config_lineno, config_input_line); @@ -736,16 +746,20 @@ parse_http_header(HttpHeaderMask * header) debug(3, 0) ("parse_http_header: expecting 'allow' or 'deny', got '%s'.\n", t); return; } - if (!http_header_first) { http_header_first = 1; - if (allowed) + if (allowed) { + http_header_allowed = 1; httpHeaderMaskInit(header, 0xFF); + } else { + http_header_allowed = 0; + httpHeaderMaskInit(header, 0); + } } while ((t = strtok(NULL, w_space))) { if ((id = httpHeaderIdByNameDef(t, strlen(t))) == -1) - id = HDR_OTHER; - if (allowed) + debug(3, 0) ("parse_http_header: Ignoring unknown header '%s'\n", t); + else if (allowed) CBIT_CLR(*header, id); else CBIT_SET(*header, id); @@ -1276,7 +1290,6 @@ parse_onoff(int *var) } #define free_onoff free_int -#define free_httpanonymizer free_int #define dump_eol dump_string #define free_eol free_string @@ -1629,30 +1642,32 @@ parse_sockaddr_in_list(sockaddr_in_list ** head) { char *token; char *t; - char *host = NULL; + char *host; const struct hostent *hp; - int i; + unsigned short port; sockaddr_in_list *s; while ((token = strtok(NULL, w_space))) { + host = NULL; + port = 0; if ((t = strchr(token, ':'))) { /* host:port */ host = token; *t = '\0'; - i = atoi(t + 1); - if (i <= 0) + port = (unsigned short) atoi(t + 1); + if (0 == port) self_destruct(); - } else if ((i = atoi(token)) > 0) { + } else if ((port = atoi(token)) > 0) { /* port */ } else { self_destruct(); } s = xcalloc(1, sizeof(*s)); - s->s.sin_port = htons(i); + s->s.sin_port = htons(port); if (NULL == host) s->s.sin_addr = any_addr; else if (1 == safe_inet_addr(host, &s->s.sin_addr)) (void) 0; - else if ((hp = gethostbyname(token))) /* dont use ipcache */ + else if ((hp = gethostbyname(host))) /* dont use ipcache */ s->s.sin_addr = inaddrFromHostent(hp); else self_destruct(); diff --git a/src/cache_diff.cc b/src/cache_diff.cc index 32a2a1b17b..b55635ae00 100644 --- a/src/cache_diff.cc +++ b/src/cache_diff.cc @@ -1,5 +1,5 @@ /* - * $Id: cache_diff.cc,v 1.10 1998/07/22 20:37:02 wessels Exp $ + * $Id: cache_diff.cc,v 1.11 2000/03/06 16:23:29 wessels Exp $ * * AUTHOR: Alex Rousskov * @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cache_manager.cc b/src/cache_manager.cc index c0690ba600..ad9aa399a0 100644 --- a/src/cache_manager.cc +++ b/src/cache_manager.cc @@ -1,6 +1,6 @@ /* - * $Id: cache_manager.cc,v 1.20 1999/01/19 02:24:21 wessels Exp $ + * $Id: cache_manager.cc,v 1.21 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 16 Cache Manager Objects * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cachemgr.cc b/src/cachemgr.cc index 1fca83c74e..9adf15c4a0 100644 --- a/src/cachemgr.cc +++ b/src/cachemgr.cc @@ -1,6 +1,6 @@ /* - * $Id: cachemgr.cc,v 1.86 1999/04/19 04:42:37 wessels Exp $ + * $Id: cachemgr.cc,v 1.87 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 0 CGI Cache Manager * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/carp.cc b/src/carp.cc index a92bf53445..ab3d9f700a 100644 --- a/src/carp.cc +++ b/src/carp.cc @@ -1,5 +1,5 @@ /* - * $Id: carp.cc,v 1.6 1998/08/17 21:55:20 wessels Exp $ + * $Id: carp.cc,v 1.7 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 39 Cache Array Routing Protocol * AUTHOR: Eric Stern @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -97,6 +97,10 @@ carpSelectParent(request_t * request) url_hash += (url_hash << 19) + *c; /* select peer */ for (tp = Config.peers; tp; tp = tp->next) { + if (0.0 == tp->carp.load_factor) + continue; + if (tp->tcp_up != PEER_TCP_MAGIC_COUNT) + continue; assert(tp->type == PEER_PARENT); combined_hash = (url_hash ^ tp->carp.hash); combined_hash += combined_hash * 0x62531965; diff --git a/src/cbdata.cc b/src/cbdata.cc index ec8d743c53..c0bf617fc7 100644 --- a/src/cbdata.cc +++ b/src/cbdata.cc @@ -1,6 +1,6 @@ /* - * $Id: cbdata.cc,v 1.28 1999/09/28 23:48:46 wessels Exp $ + * $Id: cbdata.cc,v 1.29 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 45 Callback Data Registry * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/cf.data.pre b/src/cf.data.pre index 0a3985179c..a04113d0d8 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.165 2000/01/31 23:23:04 wessels Exp $ +# $Id: cf.data.pre,v 1.166 2000/03/06 16:23:29 wessels Exp $ # # # SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ # Internet community. Development is led by Duane Wessels of the # National Laboratory for Applied Network Research and funded by the # National Science Foundation. Squid is Copyrighted (C) 1998 by -# Duane Wessels and the University of California San Diego. Please -# see the COPYRIGHT file for full details. Squid incorporates -# software developed and/or copyrighted by other sources. Please see -# the CREDITS file for full details. +# the Regents of the University of California. Please see the +# COPYRIGHT file for full details. Squid incorporates software +# developed and/or copyrighted by other sources. Please see the +# CREDITS file for full details. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,7 +42,7 @@ COMMENT_START various options happen to be. If you don't need to change the default, you shouldn't uncomment the line. Doing so may cause run-time problems. In some cases "none" refers to no default - setting at all, whilst in other cases it refers to a valid + setting at all, while in other cases it refers to a valid option - the comments for that keyword indicate if this is the case. @@ -74,13 +74,15 @@ DOC_START The default port number is 3128. - If you are running Squid in accelerateor mode, then you + If you are running Squid in accelerator mode, then you probably want to listen on port 80 also, or instead. The -a command line option will override the *first* port number listed here. That option will NOT override an IP address, however. + You may specify multiple socket addresses on multiple lines. + http_port 3128 DOC_END @@ -130,10 +132,7 @@ DOC_START receive replies from multicast group members. You must be very careful to NOT use a multicast address which - is already in use by another group of caches. NLANR has been - assigned a block of multicast address space for use in Web - Caching. Plese write to us at nlanr-cache@nlanr.net to receive - an address for your own use. + is already in use by another group of caches. If you are unsure about multicast, please read the Multicast chapter in the Squid FAQ (http://squid.nlanr.net/Squid/FAQ/). @@ -173,7 +172,7 @@ DOC_START udp_outgoing_address is used for ICP packets sent out to other caches. - The default behaviour is to not bind to any specific address. + The default behavior is to not bind to any specific address. NOTE, udp_incoming_address and udp_outgoing_address can not have the same value (unless it is 0.0.0.0) since they both use @@ -375,12 +374,15 @@ DEFAULT: 2000 TYPE: int LOC: Config.Timeout.icp_query_max DOC_START - When you use the dynamic ICP query timeout (by setting - 'icp_query_timeout' to zero) you might want to place an - upper limit on the timeout value. + Normally the ICP query timeout is determined dynamically. But + sometimes it can lead to very large values (say 5 seconds). + Use this option to put an upper limit on the dynamic timeout + value. Do NOT use this option to always use a fixed (instead + of a dynamic) timeout value. - If 'icp_query_timeout' is set to zero, this value is ignored. -icp_query_timeout 2000 + If 'icp_query_timeout' is set to zero, then this value is + ignored. +maximum_icp_query_timeout 2000 DOC_END NAME: mcast_icp_query_timeout @@ -613,8 +615,11 @@ DOC_START You can specify multiple cache_dir lines to spread the cache among different disk partitions. - Type specifies the kind of storage system to use. If you - don't know what to put here, then use "ufs". + Type specifies the kind of storage system to use. Most + everyone will want to use "ufs" as the type. If you are using + Async I/O (--enable async-io) on Linux or Solaris, then you may + want to try "asyncufs" as the type. Async IO support may be + buggy, however, so beware. 'Directory' is a top-level directory where cache swap files will be stored. If you want to use an entire disk @@ -658,7 +663,7 @@ DEFAULT: @DEFAULT_CACHE_LOG@ LOC: Config.Log.log DOC_START Cache logging file. This is where general information about - your cache's behaviour goes. You can increase the amount of data + your cache's behavior goes. You can increase the amount of data logged to this file with the "debug_options" tag below. cache_log @DEFAULT_CACHE_LOG@ @@ -673,7 +678,7 @@ DOC_START Logs the activities of the storage manager. Shows which objects are ejected from the cache, and which objects are saved and for how long. To disable, enter "none". There are - not really utilities to analyse this data, so you can safely + not really utilities to analyze this data, so you can safely disable it. cache_store_log @DEFAULT_STORE_LOG@ @@ -722,7 +727,7 @@ DOC_START programs use. To disable/enable this emulation, set emulate_httpd_log to 'off' or 'on'. The default is to use the native log format since it includes useful - information that Squid-specific log analysers use. + information that Squid-specific log analyzers use. emulate_httpd_log off DOC_END @@ -840,7 +845,7 @@ LOC: Config.Ftp.anon_user DOC_START If you want the anonymous login password to be more informative (and enable the use of picky ftp servers), set this to something - resonable for your domain, like wwwuser@somewhere.net + reasonable for your domain, like wwwuser@somewhere.net The reason why this is domainless by default is that the request can be made on the behalf of a user in any domain, @@ -865,6 +870,7 @@ DOC_END NAME: cache_dns_program TYPE: string +IFDEF: USE_DNSSERVER DEFAULT: @DEFAULT_DNSSERVER@ LOC: Config.Program.dnsserver DOC_START @@ -875,6 +881,7 @@ DOC_END NAME: dns_children TYPE: int +IFDEF: USE_DNSSERVER DEFAULT: 5 LOC: Config.dnsChildren DOC_START @@ -883,9 +890,7 @@ DOC_START probably increase this value to at least 10. The maximum is 32. The default is 5. - To disable dnsservers, set this to 0. NOTE, this is very - strongly discouraged. If you disable dnsservers your Squid - process will BLOCK on DNS lookups! + You must have at least one dnsserver process. dns_children 5 DOC_END @@ -893,6 +898,7 @@ DOC_END NAME: dns_defnames COMMENT: on|off +IFDEF: USE_DNSSERVER TYPE: onoff DEFAULT: off LOC: Config.onoff.res_defnames @@ -940,7 +946,7 @@ DEFAULT: @DEFAULT_PINGER@ LOC: Config.Program.pinger DOC_START Specify the location of the executable for the pinger process. - This is only useful if you configured Squid (during compliation) + This is only useful if you configured Squid (during compilation) with the '--enable-icmp' option. pinger_program @DEFAULT_PINGER@ @@ -1127,14 +1133,24 @@ TYPE: b_size_t DEFAULT: 0 LOC: Config.maxReplyBodySize DOC_START - This specifies the maximum size for an HTTP reply body. - This can be used to restrict users from downloading very - large files. If the reply headers include a content-length - value, then we can recognize large reply bodies early and - avoid downloading any of it. If not, we will download as - much data up to this limit and then ungraciously terminate - the transfer. If you set this parameter to zero, there - will be no limit imposed. + This option specifies the maximum size of a reply body. It + can be used to prevent users from downloading very large files, + such as MP3's and movies. The reply size is checked twice. + First when we get the reply headers, we check the + content-length value. If the content length value exists and + is larger than this parameter, the request is denied and the + user receives an error message that says "the request or reply + is too large." If there is no content-length, and the reply + size exceeds this limit, the client's connection is just closed + and they will receive a partial reply. + + NOTE: downstream caches probably can not detect a partial reply + if there is no content-length header, so they will cache + partial responses and give them out as hits. You should NOT + use this option if you have downstream caches. + + If you set this parameter to zero (the default), there will be + no limit imposed. reply_body_max_size 0 DOC_END @@ -1152,11 +1168,11 @@ DOC_START 'Min' is the time (in minutes) an object without an explicit expiry time should be considered fresh. The recommended value is 0, any higher values may cause dynamic applications - to be erronously cached unless the application designer + to be erroneously cached unless the application designer has taken the appropriate actions. 'Percent' is a percentage of the objects age (time since last - modification age) an object without explicit exipry time + modification age) an object without explicit expiry time will be considered fresh. 'Max' is an upper limit on how long objects without an explicit @@ -1245,7 +1261,7 @@ DOC_START to maximize the potential byte hit rate improvement of LFUDA. For more information about these cache replacement policies see - http://www.hpl.hp.com/personal/John_Dilley/caching/wcw.html and + http://www.hpl.hp.com/techreports/1999/HPL-1999-69.html and http://fog.hpl.external.hp.com/techreports/98/HPL-98-173.html. replacement_policy LFUDA @@ -1474,7 +1490,7 @@ DEFAULT: 1 day DOC_START The maximum amount of time that a client (browser) is allowed to remain connected to the cache process. This protects the Cache - from having alot of sockets (and hence file descriptors) tied up + from having a lot of sockets (and hence file descriptors) tied up in a CLOSE_WAIT state from remote clients that go away without properly shutting down (either because of a network failure or because of a poor client implementation). The default is one @@ -1581,8 +1597,8 @@ DOC_START acl aclname dst ip-address/netmask ... (URL host's IP address) acl aclname myip ip-address/netmask ... (local socket IP address) - acl aclname srcdomain foo.com ... # reverse lookup, client IP - acl aclname dstdomain foo.com ... # Destination server from URL + acl aclname srcdomain .foo.com ... # reverse lookup, client IP + acl aclname dstdomain .foo.com ... # Destination server from URL acl aclname srcdom_regex [-i] xxx ... # regex matching client name acl aclname dstdom_regex [-i] xxx ... # regex matching server # For dstdomain and dstdom_regex a reverse lookup is tried if a IP @@ -1887,7 +1903,7 @@ COMMENT_START create cache hierarchies. An 'announcement' message is sent (via UDP) to the registration - service by Squid. By default, the annoucement message is NOT + service by Squid. By default, the announcement message is NOT SENT unless you enable it with 'announce_period' below. The announcement message includes your hostname, plus the @@ -2499,7 +2515,7 @@ DOC_START allow specific headers (thus denying all others), or you may deny specific headers (thus allowing all others). - For example, to achieve the same behaviour as the old + For example, to achieve the same behavior as the old 'http_anonymizer standard' option, you should use: anonymize_headers deny From Referer Server @@ -2512,7 +2528,7 @@ DOC_START anonymize_headers allow Content-Encoding Content-Length anonymize_headers allow Content-Type Date Expires Host anonymize_headers allow If-Modified-Since Last-Modified - anonymize_headers allow Location Pragma Accept Charset + anonymize_headers allow Location Pragma Accept anonymize_headers allow Accept-Encoding Accept-Language anonymize_headers allow Content-Language Mime-Version anonymize_headers allow Retry-After Title Connection @@ -2557,8 +2573,8 @@ LOC: Config.errorDirectory DEFAULT: @DEFAULT_ERROR_DIR@ DOC_START If you wish to create your own versions of the default - (English) error files, either to customise them to suit your - language or company copy the template english files to another + (English) error files, either to customize them to suit your + language or company copy the template English files to another directory and point this tag at them. DOC_END @@ -2632,7 +2648,7 @@ DOC_START snmp_access allow|deny [!]aclname ... Example: -snmp_access allow snmpppublic localhost +snmp_access allow snmppublic localhost snmp_access deny all DOC_END @@ -2655,7 +2671,7 @@ DOC_START snmp_outgoing_address is used for SNMP packets returned to SNMP agents. - The default behaviour is to not bind to any specific address. + The default behavior is to not bind to any specific address. NOTE, snmp_incoming_address and snmp_outgoing_address can not have the same value since they both use port 3130. @@ -2680,10 +2696,10 @@ LOC: Config.Wccp.router DEFAULT: 0.0.0.0 IFDEF: USE_WCCP DOC_START - Specifies the router that will manage WCCP for this - cache. - -wccp_router 10.0.0.1 + Use this option to define your WCCP ``home'' router for + Squid. Setting the 'wccp_router' to 0.0.0.0 (the default) + disables WCCP. +wccp_router 0.0.0.0 DOC_END NAME: wccp_incoming_address @@ -2698,14 +2714,21 @@ LOC: Config.Wccp.outgoing DEFAULT: 255.255.255.255 IFDEF: USE_WCCP DOC_START - Just like 'udp_incoming_address' above, but for the WCCP port. + wccp_incoming_address Use this option if you require WCCP + messages to be received on only one + interface. Do NOT use this option if + you're unsure how many interfaces you + have, or if you know you have only one + interface. - wccp_incoming_address is used for the WCCP socket receiving - messages from WCCP routers. - wccp_outgoing_address is used for WCCP packets returned to WCCP - routers. + wccp_outgoing_address Use this option if you require WCCP + messages to be sent out on only one + interface. Do NOT use this option if + you're unsure how many interfaces you + have, or if you know you have only one + interface. - The default behaviour is to not bind to any specific address. + The default behavior is to not bind to any specific address. NOTE, wccp_incoming_address and wccp_outgoing_address can not have the same value since they both use port 2048. @@ -2778,7 +2801,7 @@ IFDEF: DELAY_POOLS LOC: Config.Delay DOC_START This is used to determine which delay pool a request falls into. - The first matched delay pool is always used, ie, if a request falls + The first matched delay pool is always used, i.e., if a request falls into delay pool number one, no more delay are checked, otherwise the rest are checked in order of their delay pool number until they have all been checked. For example, if you want some_big_clients in delay @@ -2993,7 +3016,7 @@ TYPE: ushort LOC: Config.mcast_miss.port DEFAULT: 3135 DOC_START - This is the port number to be used in conjuction with + This is the port number to be used in conjunction with 'mcast_miss_addr'. DOC_END @@ -3081,7 +3104,6 @@ DOC_START This controls whether the server will generate a Cache Digest of its contents. By default, Cache Digest generation is enabled if Squid is compiled with USE_CACHE_DIGESTS defined. - digest_generation on DOC_END @@ -3094,61 +3116,89 @@ DOC_START This is the number of bits of the server's Cache Digest which will be associated with the Digest entry for a given HTTP Method and URL (public key) combination. The default is 5. - digest_bits_per_entry 5 DOC_END NAME: digest_rebuild_period IFDEF: USE_CACHE_DIGESTS -TYPE: int +COMMENT: (seconds) +TYPE: time_t LOC: Config.digest.rebuild_period -DEFAULT: 3600 +DEFAULT: 1 hour DOC_START This is the number of seconds between Cache Digest rebuilds. - By default the server's Digest is rebuilt every hour - 60 - minutes * 60 seconds per minute, 3600 seconds. - -digest_rebuild_period 3600 + By default the server's Digest is rebuilt every hour. +digest_rebuild_period 1 hour DOC_END NAME: digest_rewrite_period +COMMENT: (seconds) IFDEF: USE_CACHE_DIGESTS -TYPE: int +TYPE: time_t LOC: Config.digest.rewrite_period -DEFAULT: 3600 +DEFAULT: 1 hour DOC_START This is the number of seconds between Cache Digest writes to disk. By default the server's Digest is written to disk every - hour - 60 minutes * 60 seconds per minute, 3600 seconds. - -digest_rewrite_period 3600 + hour. +digest_rewrite_period 1 hour DOC_END NAME: digest_swapout_chunk_size +COMMENT: (bytes) +TYPE: b_size_t IFDEF: USE_CACHE_DIGESTS -TYPE: int LOC: Config.digest.swapout_chunk_size -DEFAULT: 4096 +DEFAULT: 4096 bytes DOC_START This is the number of bytes of the Cache Digest to write to - disk at a time. It defaults to 4096 (4KB), the Squid default - swap page. - -digest_swapout_chunk_size 4096 + disk at a time. It defaults to 4096 bytes (4KB), the Squid + default swap page. +digest_swapout_chunk_size 4096 bytes DOC_END NAME: digest_rebuild_chunk_percentage +COMMENT: (percent, 0-100) IFDEF: USE_CACHE_DIGESTS TYPE: int LOC: Config.digest.rebuild_chunk_percentage DEFAULT: 10 DOC_START - This is the portion (where 0 < portion <= 100) of the Cache Digest - to be scanned at a time. By default it is set to 10 (10%) of - the Cache Digest. - + This is the percentage of the Cache Digest to be scanned at a + time. By default it is set to 10% of the Cache Digest. digest_rebuild_chunk_percentage 10 DOC_END +NAME: chroot +TYPE: string +LOC: Config.chroot_dir +DEFAULT: none +DOC_START + Use this to have Squid do a chroot() while initializing. This + also causes Squid to fully drop root privileges after + initializing. This means, for example, that if you use a HTTP + port less than 1024 and try to reconfigure, you will get an + error. +DOC_END +EOF + +NAME: client_persistent_connections +TYPE: onoff +LOC: Config.onoff.client_pconns +DEFAULT: on +DOC_NONE + +NAME: server_persistent_connections +TYPE: onoff +LOC: Config.onoff.server_pconns +DEFAULT: on +DOC_START + Persistent connection support for clients and servers. By + default, Squid uses persistent connections (when allowed) + with its clients and servers. You can use these options to + disable persistent connections with clients and/or servers. +client_persistent_connections on +server_persistent_connections on +DOC_END EOF diff --git a/src/cf_gen.cc b/src/cf_gen.cc index 4fe6633c23..31dae4af19 100644 --- a/src/cf_gen.cc +++ b/src/cf_gen.cc @@ -1,5 +1,5 @@ /* - * $Id: cf_gen.cc,v 1.32 1999/04/15 06:15:47 wessels Exp $ + * $Id: cf_gen.cc,v 1.33 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: none * AUTHOR: Max Okumoto @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/client.cc b/src/client.cc index 5ee167830d..b2f7368e5f 100644 --- a/src/client.cc +++ b/src/client.cc @@ -1,6 +1,6 @@ /* - * $Id: client.cc,v 1.86 1999/10/04 05:05:03 wessels Exp $ + * $Id: client.cc,v 1.87 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 0 WWW Client * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/client_db.cc b/src/client_db.cc index 358a7a57d2..c0409fe317 100644 --- a/src/client_db.cc +++ b/src/client_db.cc @@ -1,6 +1,6 @@ /* - * $Id: client_db.cc,v 1.47 1999/10/04 05:05:03 wessels Exp $ + * $Id: client_db.cc,v 1.48 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 0 Client Database * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/client_side.cc b/src/client_side.cc index 57436b6aca..3dd0d73ea5 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -1,6 +1,6 @@ /* - * $Id: client_side.cc,v 1.470 2000/01/19 21:57:30 wessels Exp $ + * $Id: client_side.cc,v 1.471 2000/03/06 16:23:29 wessels Exp $ * * DEBUG: section 33 Client-side Routines * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -105,6 +105,7 @@ static int clientCheckContentLength(request_t * r); static int httpAcceptDefer(void); static log_type clientProcessRequest2(clientHttpRequest * http); static int clientReplyBodyTooLarge(int clen); +static int clientRequestBodyTooLarge(int clen); static int checkAccelOnly(clientHttpRequest * http) @@ -140,7 +141,7 @@ clientAccessCheck(void *data) clientHttpRequest *http = data; ConnStateData *conn = http->conn; if (checkAccelOnly(http)) { - clientAccessCheckDone(0, http); + clientAccessCheckDone(ACCESS_ALLOWED, http); return; } http->acl_checklist = aclChecklistCreate(Config.accessList.http, @@ -851,11 +852,9 @@ clientSetKeepaliveFlag(clientHttpRequest * http) request->http_ver); debug(33, 3) ("clientSetKeepaliveFlag: method = %s\n", RequestMethodStr[request->method]); - /* - * If we wanted to limit the number of client-side idle persistent - * connections, this is a good place to do it. - */ - if (httpMsgIsPersistent(request->http_ver, req_hdr)) + if (!Config.onoff.client_pconns) + request->flags.proxy_keepalive = 0; + else if (httpMsgIsPersistent(request->http_ver, req_hdr)) request->flags.proxy_keepalive = 1; } @@ -1168,20 +1167,29 @@ clientBuildReplyHeader(clientHttpRequest * http, HttpReply * rep) if (request->range) clientBuildRangeHeader(http, rep); /* - * Add Age header, not that our header must replace Age headers - * from other caches if any + * Add a estimated Age header on cache hits. */ - if (http->entry->timestamp > 0) { + if (is_hit) { + /* + * Remove any existing Age header sent by upstream caches + * (note that the existing header is passed along unmodified + * on cache misses) + */ httpHeaderDelById(hdr, HDR_AGE); /* - * we do not follow HTTP/1.1 precisely here becuase we rely - * on Date header when computing entry->timestamp; we should - * be using _request_ time if Date header is not available - * or if it is out of sync + * This adds the calculated object age. Note that the details of the + * age calculation is performed by adjusting the timestamp in + * storeTimestampsSet(), not here. + * + * BROWSER WORKAROUND: IE sometimes hangs when receiving a 0 Age + * header, so don't use it unless there is a age to report. Please + * note that Age is only used to make a conservative estimation of + * the objects age, so a Age: 0 header does not add any useful + * information to the reply in any case. */ - httpHeaderPutInt(hdr, HDR_AGE, - http->entry->timestamp <= squid_curtime ? - squid_curtime - http->entry->timestamp : 0); + if (http->entry->timestamp < squid_curtime) + httpHeaderPutInt(hdr, HDR_AGE, + squid_curtime - http->entry->timestamp); } /* Append X-Cache */ httpHeaderPutStrf(hdr, HDR_X_CACHE, "%s from %s", @@ -1569,6 +1577,18 @@ clientReplyBodyTooLarge(int clen) return 0; } +static int +clientRequestBodyTooLarge(int clen) +{ + if (0 == Config.maxRequestBodySize) + return 0; /* disabled */ + if (clen < 0) + return 0; /* unknown, bug? */ + if (clen > Config.maxRequestBodySize) + return 1; /* too large */ + return 0; +} + /* * accepts chunk of a http message in buf, parses prefix, filters headers and * such, writes processed message to the client's socket @@ -1773,7 +1793,7 @@ clientWriteComplete(int fd, char *bufnotused, size_t size, int errflag, void *da } else if ((done = clientCheckTransferDone(http)) != 0 || size == 0) { debug(33, 5) ("clientWriteComplete: FD %d transfer is DONE\n", fd); /* We're finished case */ - if (http->entry->mem_obj->reply->content_length < 0) { + if (httpReplyBodySize(http->request->method, entry->mem_obj->reply) < 0) { debug(33, 5) ("clientWriteComplete: closing, content_length < 0\n"); comm_close(fd); } else if (!done) { @@ -2010,6 +2030,9 @@ clientProcessMiss(clientHttpRequest * http) http->entry = clientCreateStoreEntry(http, r->method, r->flags); if (http->redirect.status) { HttpReply *rep = httpReplyCreate(); +#if LOG_TCP_REDIRECTS + http->log_type = LOG_TCP_REDIRECT; +#endif storeReleaseRequest(http->entry); httpRedirectReply(rep, http->redirect.status, http->redirect.location); httpReplySwapOut(rep, http->entry); @@ -2479,7 +2502,7 @@ clientReadRequest(int fd, void *data) commSetSelect(fd, COMM_SELECT_READ, NULL, NULL, 0); if (request->content_length < 0) (void) 0; - else if (request->content_length > Config.maxRequestBodySize) { + else if (clientRequestBodyTooLarge(request->content_length)) { err = errorCon(ERR_TOO_BIG, HTTP_REQUEST_ENTITY_TOO_LARGE); err->request = requestLink(request); http->entry = clientCreateStoreEntry(http, @@ -2498,11 +2521,6 @@ clientReadRequest(int fd, void *data) k = conn->in.size - 1 - conn->in.offset; if (k == 0) { if (conn->in.offset >= Config.maxRequestHeaderSize) { - int fd = open("/tmp/error:request-too-large", O_WRONLY | O_CREAT | O_TRUNC); - if (fd >= 0) { - write(fd, conn->in.buf, conn->in.offset); - close(fd); - } /* The request is too large to handle */ debug(33, 1) ("Request header is too large (%d bytes)\n", (int) conn->in.offset); @@ -2709,7 +2727,7 @@ clientCheckTransferDone(clientHttpRequest * http) static int clientGotNotEnough(clientHttpRequest * http) { - int cl = http->entry->mem_obj->reply->content_length; + int cl = httpReplyBodySize(http->request->method, http->entry->mem_obj->reply); int hs = http->entry->mem_obj->reply->hdr_sz; assert(cl >= 0); if (http->out.offset < cl + hs) diff --git a/src/comm.cc b/src/comm.cc index 87a1b9da35..1168e19814 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -1,6 +1,6 @@ /* - * $Id: comm.cc,v 1.304 1999/12/30 17:36:27 wessels Exp $ + * $Id: comm.cc,v 1.305 2000/03/06 16:23:30 wessels Exp $ * * DEBUG: section 5 Socket Functions * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/comm_select.cc b/src/comm_select.cc index 20e13595d8..dcaeb0c714 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -1,6 +1,6 @@ /* - * $Id: comm_select.cc,v 1.40 2000/01/11 04:37:44 wessels Exp $ + * $Id: comm_select.cc,v 1.41 2000/03/06 16:23:30 wessels Exp $ * * DEBUG: section 5 Socket Functions * @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/debug.cc b/src/debug.cc index 5ce1ab87f8..18269c0034 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -1,6 +1,6 @@ /* - * $Id: debug.cc,v 1.77 1999/10/04 05:05:07 wessels Exp $ + * $Id: debug.cc,v 1.78 2000/03/06 16:23:30 wessels Exp $ * * DEBUG: section 0 Debug Routines * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/defines.h b/src/defines.h index 987975e85a..9990caa3e3 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1,6 +1,6 @@ /* - * $Id: defines.h,v 1.77 1999/12/30 17:36:29 wessels Exp $ + * $Id: defines.h,v 1.78 2000/03/06 16:23:30 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/delay_pools.cc b/src/delay_pools.cc index ced7ac6144..eadb75695e 100644 --- a/src/delay_pools.cc +++ b/src/delay_pools.cc @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.cc,v 1.12 1999/12/30 17:36:30 wessels Exp $ + * $Id: delay_pools.cc,v 1.13 2000/03/06 16:23:30 wessels Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: David Luyer @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,30 +42,35 @@ struct _class1DelayPool { int aggregate; }; +#define IND_MAP_SZ 256 + struct _class2DelayPool { int aggregate; /* OK: -1 is terminator. individual[255] is always host 255. */ /* 255 entries + 1 terminator byte */ - unsigned char individual_map[256]; + unsigned char individual_map[IND_MAP_SZ]; unsigned char individual_255_used; /* 256 entries */ - int individual[256]; + int individual[IND_MAP_SZ]; }; +#define NET_MAP_SZ 256 +#define C3_IND_SZ (NET_MAP_SZ*IND_MAP_SZ) + struct _class3DelayPool { int aggregate; /* OK: -1 is terminator. network[255] is always host 255. */ /* 255 entries + 1 terminator byte */ - unsigned char network_map[256]; + unsigned char network_map[NET_MAP_SZ]; unsigned char network_255_used; /* 256 entries */ int network[256]; /* 256 sets of (255 entries + 1 terminator byte) */ - unsigned char individual_map[256][256]; + unsigned char individual_map[NET_MAP_SZ][IND_MAP_SZ]; /* Pack this into one bit per net */ unsigned char individual_255_used[32]; /* largest entry = (255<<8)+255 = 65535 */ - int individual[65536]; + int individual[C3_IND_SZ]; }; typedef struct _class1DelayPool class1DelayPool; @@ -301,17 +306,18 @@ delayClient(request_t * r) if (host == 255) { if (!delay_data[pool].class2->individual_255_used) { delay_data[pool].class2->individual_255_used = 1; - delay_data[pool].class2->individual[255] = + delay_data[pool].class2->individual[IND_MAP_SZ - 1] = (Config.Delay.rates[pool]->individual.max_bytes * Config.Delay.initial) / 100; } return delayId(pool + 1, 255); } - for (i = 0;; i++) { + for (i = 0; i < IND_MAP_SZ; i++) { if (delay_data[pool].class2->individual_map[i] == host) break; if (delay_data[pool].class2->individual_map[i] == 255) { delay_data[pool].class2->individual_map[i] = host; + assert(i < (IND_MAP_SZ - 1)); delay_data[pool].class2->individual_map[i + 1] = 255; delay_data[pool].class2->individual[i] = (Config.Delay.rates[pool]->individual.max_bytes * @@ -334,12 +340,13 @@ delayClient(request_t * r) Config.Delay.initial) / 100; } } else { - for (i = 0;; i++) { + for (i = 0; i < NET_MAP_SZ; i++) { if (delay_data[pool].class3->network_map[i] == net) break; if (delay_data[pool].class3->network_map[i] == 255) { delay_data[pool].class3->network_map[i] = net; delay_data[pool].class3->individual_map[i][0] = 255; + assert(i < (NET_MAP_SZ - 1)); delay_data[pool].class3->network_map[i + 1] = 255; delay_data[pool].class3->network[i] = (Config.Delay.rates[pool]->network.max_bytes * @@ -353,21 +360,26 @@ delayClient(request_t * r) position |= 255; if (!(delay_data[pool].class3->individual_255_used[i / 8] & (1 << (i % 8)))) { delay_data[pool].class3->individual_255_used[i / 8] |= (1 << (i % 8)); + assert(position < C3_IND_SZ); delay_data[pool].class3->individual[position] = (Config.Delay.rates[pool]->individual.max_bytes * Config.Delay.initial) / 100; } return delayId(pool + 1, position); } - for (j = 0;; j++) { + assert(i < NET_MAP_SZ); + for (j = 0; j < IND_MAP_SZ; j++) { if (delay_data[pool].class3->individual_map[i][j] == host) { position |= j; break; } if (delay_data[pool].class3->individual_map[i][j] == 255) { delay_data[pool].class3->individual_map[i][j] = host; + assert(j < (IND_MAP_SZ - 1)); delay_data[pool].class3->individual_map[i][j + 1] = 255; - delay_data[pool].class3->individual[position |= j] = + position |= j; + assert(position < C3_IND_SZ); + delay_data[pool].class3->individual[position] = (Config.Delay.rates[pool]->individual.max_bytes * Config.Delay.initial) / 100; break; @@ -392,7 +404,7 @@ static void delayUpdateClass2(class2DelayPool * class2, delaySpecSet * rates, int incr) { int restore_bytes; - unsigned char i; + unsigned int i; /* delaySetSpec may be pointer to partial structure so MUST pass by * reference. */ @@ -408,12 +420,13 @@ delayUpdateClass2(class2DelayPool * class2, delaySpecSet * rates, int incr) else i = 0; for (;;) { + assert(i < IND_MAP_SZ); if (i != 255 && class2->individual_map[i] == 255) return; if (class2->individual[i] != rates->individual.max_bytes && (class2->individual[i] += restore_bytes) > rates->individual.max_bytes) class2->individual[i] = rates->individual.max_bytes; - if (++i == 255) + if (++i == (IND_MAP_SZ - 1)) return; } } @@ -423,7 +436,7 @@ delayUpdateClass3(class3DelayPool * class3, delaySpecSet * rates, int incr) { int individual_restore_bytes, network_restore_bytes; int mpos; - unsigned char i, j; + unsigned int i, j; /* delaySetSpec may be pointer to partial structure so MUST pass by * reference. */ @@ -444,6 +457,7 @@ delayUpdateClass3(class3DelayPool * class3, delaySpecSet * rates, int incr) else i = 0; for (;;) { + assert(i < NET_MAP_SZ); if (i != 255 && class3->network_map[i] == 255) return; if (individual_restore_bytes != -incr) { @@ -453,16 +467,19 @@ delayUpdateClass3(class3DelayPool * class3, delaySpecSet * rates, int incr) else j = 0; for (;;) { + assert(i < NET_MAP_SZ); + assert(j < IND_MAP_SZ); if (j != 255 && class3->individual_map[i][j] == 255) break; + assert(mpos < C3_IND_SZ); if (class3->individual[mpos] != rates->individual.max_bytes && (class3->individual[mpos] += individual_restore_bytes) > rates->individual.max_bytes) class3->individual[mpos] = rates->individual.max_bytes; mpos++; - if (j == 255) + if (j == (IND_MAP_SZ - 1)) mpos -= 256; - if (++j == 255) + if (++j == (IND_MAP_SZ - 1)) break; } } @@ -471,7 +488,7 @@ delayUpdateClass3(class3DelayPool * class3, delaySpecSet * rates, int incr) (class3->network[i] += network_restore_bytes) > rates->network.max_bytes) class3->network[i] = rates->network.max_bytes; - if (++i == 255) + if (++i == (NET_MAP_SZ - 1)) return; } } @@ -663,7 +680,8 @@ delayPoolStats2(StoreEntry * sentry, unsigned short pool) /* must be a reference only - partially malloc()d struct */ delaySpecSet *rate = Config.Delay.rates[pool]; class2DelayPool *class2 = delay_data[pool].class2; - unsigned char shown = 0, i; + unsigned char shown = 0; + unsigned int i; storeAppendPrintf(sentry, "Pool: %d\n\tClass: 2\n\n", pool + 1); delayPoolStatsAg(sentry, rate, class2->aggregate); @@ -675,7 +693,7 @@ delayPoolStats2(StoreEntry * sentry, unsigned short pool) storeAppendPrintf(sentry, "\t\tMax: %d\n", rate->individual.max_bytes); storeAppendPrintf(sentry, "\t\tRate: %d\n", rate->individual.restore_bps); storeAppendPrintf(sentry, "\t\tCurrent: "); - for (i = 0;; i++) { + for (i = 0; i < IND_MAP_SZ; i++) { if (class2->individual_map[i] == 255) break; storeAppendPrintf(sentry, "%d:%d ", class2->individual_map[i], @@ -697,7 +715,9 @@ delayPoolStats3(StoreEntry * sentry, unsigned short pool) /* fully malloc()d struct in this case only */ delaySpecSet *rate = Config.Delay.rates[pool]; class3DelayPool *class3 = delay_data[pool].class3; - unsigned char shown = 0, i, j; + unsigned char shown = 0; + unsigned int i; + unsigned int j; storeAppendPrintf(sentry, "Pool: %d\n\tClass: 3\n\n", pool + 1); delayPoolStatsAg(sentry, rate, class3->aggregate); @@ -708,7 +728,7 @@ delayPoolStats3(StoreEntry * sentry, unsigned short pool) storeAppendPrintf(sentry, "\t\tMax: %d\n", rate->network.max_bytes); storeAppendPrintf(sentry, "\t\tRate: %d\n", rate->network.restore_bps); storeAppendPrintf(sentry, "\t\tCurrent: "); - for (i = 0;; i++) { + for (i = 0; i < NET_MAP_SZ; i++) { if (class3->network_map[i] == 255) break; storeAppendPrintf(sentry, "%d:%d ", class3->network_map[i], @@ -731,12 +751,12 @@ delayPoolStats3(StoreEntry * sentry, unsigned short pool) storeAppendPrintf(sentry, "\tIndividual:\n"); storeAppendPrintf(sentry, "\t\tMax: %d\n", rate->individual.max_bytes); storeAppendPrintf(sentry, "\t\tRate: %d\n", rate->individual.restore_bps); - for (i = 0;; i++) { + for (i = 0; i < NET_MAP_SZ; i++) { if (class3->network_map[i] == 255) break; storeAppendPrintf(sentry, "\t\tCurrent [Network %d]: ", class3->network_map[i]); shown = 1; - for (j = 0;; j++) { + for (j = 0; j < IND_MAP_SZ; j++) { if (class3->individual_map[i][j] == 255) break; storeAppendPrintf(sentry, "%d:%d ", class3->individual_map[i][j], @@ -750,7 +770,7 @@ delayPoolStats3(StoreEntry * sentry, unsigned short pool) if (class3->network_255_used) { storeAppendPrintf(sentry, "\t\tCurrent [Network 255]: "); shown = 1; - for (j = 0;; j++) { + for (j = 0; j < IND_MAP_SZ; j++) { if (class3->individual_map[255][j] == 255) break; storeAppendPrintf(sentry, "%d:%d ", class3->individual_map[255][j], diff --git a/src/disk.cc b/src/disk.cc index b6782ba2f2..bdd225de24 100644 --- a/src/disk.cc +++ b/src/disk.cc @@ -1,6 +1,6 @@ /* - * $Id: disk.cc,v 1.146 1999/05/26 17:07:57 wessels Exp $ + * $Id: disk.cc,v 1.147 2000/03/06 16:23:30 wessels Exp $ * * DEBUG: section 6 Disk I/O Routines * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dns.cc b/src/dns.cc index b1676481a0..63005cd05c 100644 --- a/src/dns.cc +++ b/src/dns.cc @@ -1,6 +1,6 @@ /* - * $Id: dns.cc,v 1.80 1999/12/30 17:36:30 wessels Exp $ + * $Id: dns.cc,v 1.81 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 34 Dnsserver interface * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/dns_internal.cc b/src/dns_internal.cc index fa4fa6401d..8b8ae9243a 100644 --- a/src/dns_internal.cc +++ b/src/dns_internal.cc @@ -1,6 +1,6 @@ /* - * $Id: dns_internal.cc,v 1.17 1999/10/04 19:10:52 wessels Exp $ + * $Id: dns_internal.cc,v 1.18 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 78 DNS lookups; interacts with lib/rfc1035.c * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,6 +76,7 @@ static int event_queued = 0; static OBJH idnsStats; static void idnsAddNameserver(const char *buf); static void idnsFreeNameservers(void); +static void idnsParseNameservers(void); static void idnsParseResolvConf(void); static void idnsSendQuery(idns_query * q); static int idnsFromKnownNameserver(struct sockaddr_in *from); @@ -83,6 +84,7 @@ static idns_query *idnsFindQuery(unsigned short id); static void idnsGrokReply(const char *buf, size_t sz); static PF idnsRead; static EVH idnsCheckQueue; +static void idnsTickleQueue(void); static void idnsAddNameserver(const char *buf) @@ -104,7 +106,7 @@ idnsAddNameserver(const char *buf) nameservers[nns].S.sin_family = AF_INET; nameservers[nns].S.sin_port = htons(DOMAIN_PORT); nameservers[nns].S.sin_addr.s_addr = inet_addr(buf); - debug(78, 1) ("idnsAddNameserver: Added nameserver #%d: %s\n", + debug(78, 3) ("idnsAddNameserver: Added nameserver #%d: %s\n", nns, inet_ntoa(nameservers[nns].S.sin_addr)); nns++; } @@ -116,6 +118,16 @@ idnsFreeNameservers(void) nns = nns_alloc = 0; } +static void +idnsParseNameservers(void) +{ + wordlist *w; + for (w = Config.dns_nameservers; w; w = w->next) { + debug(78, 1) ("Adding nameserver %s from squid.conf\n", w->key); + idnsAddNameserver(w->key); + } +} + static void idnsParseResolvConf(void) { @@ -127,7 +139,6 @@ idnsParseResolvConf(void) debug(78, 1) ("%s: %s\n", _PATH_RESOLV_CONF, xstrerror()); return; } - idnsFreeNameservers(); while (fgets(buf, 512, fp)) { t = strtok(buf, w_space); if (NULL == t) @@ -137,7 +148,7 @@ idnsParseResolvConf(void) t = strtok(NULL, w_space); if (t == NULL) continue;; - debug(78, 1) ("idnsParseResolvConf: nameserver %s\n", t); + debug(78, 1) ("Adding nameserver %s from %s\n", t, _PATH_RESOLV_CONF); idnsAddNameserver(t); } fclose(fp); @@ -172,6 +183,17 @@ idnsStats(StoreEntry * sentry) } } +static void +idnsTickleQueue(void) +{ + if (event_queued) + return; + if (NULL == lru_list.tail) + return; + eventAdd("idnsCheckQueue", idnsCheckQueue, NULL, 1.0, 1); + event_queued = 1; +} + static void idnsSendQuery(idns_query * q) { @@ -202,10 +224,7 @@ idnsSendQuery(idns_query * q) q->sent_t = current_time; nameservers[ns].nqueries++; dlinkAdd(q, &q->lru, &lru_list); - if (!event_queued) { - eventAdd("idnsCheckQueue", idnsCheckQueue, NULL, 1.0, 1); - event_queued = 1; - } + idnsTickleQueue(); } static int @@ -353,6 +372,7 @@ idnsCheckQueue(void *unused) memFree(q, MEM_IDNS_QUERY); } } + idnsTickleQueue(); } /* ====================================================================== */ @@ -372,7 +392,9 @@ idnsInit(void) fatal("Could not create a DNS socket"); debug(78, 1) ("DNS Socket created on FD %d\n", DnsSocket); } - if (nns == 0) + assert(0 == nns); + idnsParseNameservers(); + if (0 == nns) idnsParseResolvConf(); if (!init) { memDataInit(MEM_IDNS_QUERY, "idns_query", sizeof(idns_query), 0); @@ -390,6 +412,7 @@ idnsShutdown(void) return; comm_close(DnsSocket); DnsSocket = -1; + idnsFreeNameservers(); } void diff --git a/src/dnsserver.cc b/src/dnsserver.cc index 784267d335..48e1865c01 100644 --- a/src/dnsserver.cc +++ b/src/dnsserver.cc @@ -1,6 +1,6 @@ /* - * $Id: dnsserver.cc,v 1.56 1999/01/13 23:24:12 wessels Exp $ + * $Id: dnsserver.cc,v 1.57 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 0 DNS Resolver * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/enums.h b/src/enums.h index 11d250ecaf..5e20690665 100644 --- a/src/enums.h +++ b/src/enums.h @@ -1,6 +1,6 @@ /* - * $Id: enums.h,v 1.162 1999/12/30 17:36:31 wessels Exp $ + * $Id: enums.h,v 1.163 2000/03/06 16:23:31 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -45,6 +45,9 @@ typedef enum { LOG_TCP_MEM_HIT, LOG_TCP_DENIED, LOG_TCP_OFFLINE_HIT, +#if LOG_TCP_REDIRECTS + LOG_TCP_REDIRECT, +#endif LOG_UDP_HIT, LOG_UDP_MISS, LOG_UDP_DENIED, @@ -197,6 +200,7 @@ typedef enum { HDR_CONTENT_MD5, HDR_CONTENT_RANGE, HDR_CONTENT_TYPE, + HDR_COOKIE, HDR_DATE, HDR_ETAG, HDR_EXPIRES, diff --git a/src/errorpage.cc b/src/errorpage.cc index 7b4c22385a..c5706e8062 100644 --- a/src/errorpage.cc +++ b/src/errorpage.cc @@ -1,6 +1,6 @@ /* - * $Id: errorpage.cc,v 1.152 1999/10/04 05:05:10 wessels Exp $ + * $Id: errorpage.cc,v 1.153 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 4 Error Generation * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/event.cc b/src/event.cc index db164bf580..5cdb00db29 100644 --- a/src/event.cc +++ b/src/event.cc @@ -1,6 +1,6 @@ /* - * $Id: event.cc,v 1.28 1999/04/19 04:49:12 wessels Exp $ + * $Id: event.cc,v 1.29 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 41 Event Processing * AUTHOR: Henrik Nordstrom @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/fd.cc b/src/fd.cc index 7192715de5..4995a40ff6 100644 --- a/src/fd.cc +++ b/src/fd.cc @@ -1,6 +1,6 @@ /* - * $Id: fd.cc,v 1.37 1999/05/03 21:55:02 wessels Exp $ + * $Id: fd.cc,v 1.38 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 51 Filedescriptor Functions * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/filemap.cc b/src/filemap.cc index 2e5e1963f7..c54c0b4bb0 100644 --- a/src/filemap.cc +++ b/src/filemap.cc @@ -1,6 +1,6 @@ /* - * $Id: filemap.cc,v 1.33 2000/01/11 04:57:15 wessels Exp $ + * $Id: filemap.cc,v 1.34 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 8 Swap File Bitmap * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/forward.cc b/src/forward.cc index 5998830a52..6de07fddd6 100644 --- a/src/forward.cc +++ b/src/forward.cc @@ -1,6 +1,6 @@ /* - * $Id: forward.cc,v 1.68 2000/01/11 04:58:03 wessels Exp $ + * $Id: forward.cc,v 1.69 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 17 Request Forwarding * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -111,7 +111,7 @@ fwdCheckRetry(FwdState * fwdState) return 0; if (fwdState->n_tries > 10) return 0; - if (squid_curtime - fwdState->start > 120) + if (squid_curtime - fwdState->start > Config.Timeout.connect) return 0; if (fwdState->flags.dont_retry) return 0; @@ -206,6 +206,12 @@ fwdConnectTimeout(int fd, void *data) err->request = requestLink(fwdState->request); err->xerrno = ETIMEDOUT; fwdFail(fwdState, err); + /* + * This marks the peer DOWN ... + */ + if (fwdState->servers) + if (fwdState->servers->peer) + peerCheckConnectStart(fwdState->servers->peer); } comm_close(fd); } diff --git a/src/fqdncache.cc b/src/fqdncache.cc index 7c26b0dbbc..fcf275e691 100644 --- a/src/fqdncache.cc +++ b/src/fqdncache.cc @@ -1,7 +1,7 @@ /* - * $Id: fqdncache.cc,v 1.131 1999/06/17 22:20:39 wessels Exp $ + * $Id: fqdncache.cc,v 1.132 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 35 FQDN Cache * AUTHOR: Harvest Derived @@ -13,10 +13,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ftp.cc b/src/ftp.cc index 8b3e702d50..df6db959f9 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.288 1999/12/30 17:36:33 wessels Exp $ + * $Id: ftp.cc,v 1.289 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -568,6 +568,8 @@ ftpListParseParts(const char *buf, struct _ftp_flags flags) ct = buf + 1; p->type = 0; while (ct && *ct) { + long lt; + time_t t; switch (*ct) { case '\t': sscanf(ct + 1, "%[^,]", sbuf); @@ -577,8 +579,10 @@ ftpListParseParts(const char *buf, struct _ftp_flags flags) sscanf(ct + 1, "%d", &(p->size)); break; case 'm': - sscanf(ct + 1, "%d", &i); - p->date = xstrdup(ctime((time_t *) & i)); + if (1 != sscanf(ct + 1, "%ld", <)) + break; + t = lt; + p->date = xstrdup(ctime(&t)); *(strstr(p->date, "\n")) = '\0'; break; case '/': diff --git a/src/globals.h b/src/globals.h index 9ad03a44e3..9dc83cadfd 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1,6 +1,6 @@ /* - * $Id: globals.h,v 1.86 1999/12/30 17:36:35 wessels Exp $ + * $Id: globals.h,v 1.87 2000/03/06 16:23:31 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/gopher.cc b/src/gopher.cc index 4b2697eee1..feb6dbb03c 100644 --- a/src/gopher.cc +++ b/src/gopher.cc @@ -1,7 +1,7 @@ /* - * $Id: gopher.cc,v 1.151 1999/10/04 05:05:13 wessels Exp $ + * $Id: gopher.cc,v 1.152 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 10 Gopher * AUTHOR: Harvest Derived @@ -13,10 +13,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/htcp.cc b/src/htcp.cc index 9a7a42376f..b54bb8f243 100644 --- a/src/htcp.cc +++ b/src/htcp.cc @@ -1,6 +1,6 @@ /* - * $Id: htcp.cc,v 1.29 1999/12/30 17:36:35 wessels Exp $ + * $Id: htcp.cc,v 1.30 2000/03/06 16:23:31 wessels Exp $ * * DEBUG: section 31 Hypertext Caching Protocol * AUTHOR: Duane Wesssels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -805,7 +805,7 @@ htcpHandle(char *buf, int sz, struct sockaddr_in *from) debug(31, 3) ("htcpHandle: htcpHdr.major = %d\n", (int) htcpHdr.major); debug(31, 3) ("htcpHandle: htcpHdr.minor = %d\n", (int) htcpHdr.minor); if (sz != htcpHdr.length) { - debug(31, 0) ("htcpHandle: sz != htcpHdr.length\n"); + debug(31, 1) ("htcpHandle: sz != htcpHdr.length\n"); return; } buf += sizeof(htcpHeader); diff --git a/src/http.cc b/src/http.cc index 1b45600c8e..571ac13dc8 100644 --- a/src/http.cc +++ b/src/http.cc @@ -1,6 +1,6 @@ /* - * $Id: http.cc,v 1.355 1999/12/30 17:36:36 wessels Exp $ + * $Id: http.cc,v 1.356 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 11 Hypertext Transfer Protocol (HTTP) * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -854,7 +854,9 @@ httpSendRequest(HttpStateData * httpState) /* * Is keep-alive okay for all request methods? */ - if (p == NULL) + if (!Config.onoff.server_pconns) + httpState->flags.keepalive = 0; + else if (p == NULL) httpState->flags.keepalive = 1; else if (p->stats.n_keepalives_sent < 10) httpState->flags.keepalive = 1; diff --git a/src/icmp.cc b/src/icmp.cc index 69603284dc..2dc1e8c0d9 100644 --- a/src/icmp.cc +++ b/src/icmp.cc @@ -1,6 +1,6 @@ /* - * $Id: icmp.cc,v 1.69 1998/12/05 00:54:29 wessels Exp $ + * $Id: icmp.cc,v 1.70 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 37 ICMP Routines * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/icp_v2.cc b/src/icp_v2.cc index 27428043a2..84de369b0a 100644 --- a/src/icp_v2.cc +++ b/src/icp_v2.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v2.cc,v 1.61 1999/12/30 17:36:37 wessels Exp $ + * $Id: icp_v2.cc,v 1.62 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/icp_v3.cc b/src/icp_v3.cc index ba8ad84a88..9e2271ab86 100644 --- a/src/icp_v3.cc +++ b/src/icp_v3.cc @@ -1,6 +1,6 @@ /* - * $Id: icp_v3.cc,v 1.30 1999/06/14 03:02:07 wessels Exp $ + * $Id: icp_v3.cc,v 1.31 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 12 Internet Cache Protocol * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ident.cc b/src/ident.cc index 4110d0c28e..57571a3e8e 100644 --- a/src/ident.cc +++ b/src/ident.cc @@ -1,6 +1,6 @@ /* - * $Id: ident.cc,v 1.50 1999/04/15 06:15:59 wessels Exp $ + * $Id: ident.cc,v 1.51 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 30 Ident (RFC 931) * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/internal.cc b/src/internal.cc index 05869f3fe4..f076d4fb90 100644 --- a/src/internal.cc +++ b/src/internal.cc @@ -1,6 +1,6 @@ /* - * $Id: internal.cc,v 1.17 1999/12/30 17:36:38 wessels Exp $ + * $Id: internal.cc,v 1.18 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 76 Internal Squid Object handling * AUTHOR: Duane, Alex, Henrik @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ipc.cc b/src/ipc.cc index 388c4e290b..1f08eb044d 100644 --- a/src/ipc.cc +++ b/src/ipc.cc @@ -1,6 +1,6 @@ /* - * $Id: ipc.cc,v 1.17 1999/12/30 17:36:39 wessels Exp $ + * $Id: ipc.cc,v 1.18 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 54 Interprocess Communication * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ipcache.cc b/src/ipcache.cc index ee6cd1aa86..eb6ee01bc8 100644 --- a/src/ipcache.cc +++ b/src/ipcache.cc @@ -1,6 +1,6 @@ /* - * $Id: ipcache.cc,v 1.218 1999/12/30 17:36:40 wessels Exp $ + * $Id: ipcache.cc,v 1.219 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 14 IP Cache * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/leakfinder.cc b/src/leakfinder.cc index b6e6b69a8d..c87bcba91f 100644 --- a/src/leakfinder.cc +++ b/src/leakfinder.cc @@ -1,6 +1,6 @@ /* - * $Id: leakfinder.cc,v 1.2 2000/01/05 06:23:44 wessels Exp $ + * $Id: leakfinder.cc,v 1.3 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 45 Callback Data Registry * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/main.cc b/src/main.cc index dee88385ea..c215569533 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.307 1999/12/30 17:36:41 wessels Exp $ + * $Id: main.cc,v 1.308 2000/03/06 16:23:32 wessels Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -71,6 +71,7 @@ extern void log_trace_init(char *); #endif static EVH SquidShutdown; static void mainSetCwd(void); +static int checkRunningPid(void); static const char *squid_start_script = "squid_start"; @@ -431,6 +432,10 @@ mainSetCwd(void) static void mainInitialize(void) { + /* chroot if configured to run inside chroot */ + if (Config.chroot_dir && chroot(Config.chroot_dir)) { + fatal("failed to chroot"); + } if (opt_catch_signals) { squid_signal(SIGSEGV, death, SA_NODEFER | SA_RESETHAND); squid_signal(SIGBUS, death, SA_NODEFER | SA_RESETHAND); @@ -511,6 +516,8 @@ mainInitialize(void) else debug(1, 1) ("ICP port disabled in httpd_accelerator mode\n"); } + if (Config.chroot_dir) + no_suid(); if (!configured_once) writePidFile(); /* write PID file */ @@ -610,6 +617,9 @@ main(int argc, char **argv) if (opt_parse_cfg_only) return parse_err; } + if (-1 == opt_send_signal) + if (checkRunningPid()) + exit(1); #if TEST_ACCESS comm_init(); @@ -621,10 +631,18 @@ main(int argc, char **argv) /* send signal to running copy and exit */ if (opt_send_signal != -1) { + /* chroot if configured to run inside chroot */ + if (Config.chroot_dir && chroot(Config.chroot_dir)) { + fatal("failed to chroot"); + } sendSignal(); /* NOTREACHED */ } if (opt_create_swap_dirs) { + /* chroot if configured to run inside chroot */ + if (Config.chroot_dir && chroot(Config.chroot_dir)) { + fatal("failed to chroot"); + } setEffectiveUser(); debug(0, 0) ("Creating Swap Directories\n"); storeCreateSwapDirectories(); @@ -766,6 +784,20 @@ mainStartScript(const char *prog) } } +static int +checkRunningPid(void) +{ + pid_t pid; + debug_log = stderr; + pid = readPidFile(); + if (pid < 2) + return 0; + if (kill(pid, 0) < 0) + return 0; + debug(0, 0) ("Squid is already running! Process ID %d\n", pid); + return 1; +} + static void watch_child(char *argv[]) { @@ -789,6 +821,7 @@ watch_child(char *argv[]) exit(0); if (setsid() < 0) syslog(LOG_ALERT, "setsid failed: %s", xstrerror()); + closelog(); #ifdef TIOCNOTTY if ((i = open("/dev/tty", O_RDWR)) >= 0) { ioctl(i, TIOCNOTTY, NULL); @@ -801,12 +834,14 @@ watch_child(char *argv[]) mainStartScript(argv[0]); if ((pid = fork()) == 0) { /* child */ + openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); prog = xstrdup(argv[0]); argv[0] = xstrdup("(squid)"); execvp(prog, argv); syslog(LOG_ALERT, "execvp failed: %s", xstrerror()); } /* parent */ + openlog(appname, LOG_PID | LOG_NDELAY | LOG_CONS, LOG_LOCAL4); syslog(LOG_NOTICE, "Squid Parent: child process %d started", pid); time(&start); squid_signal(SIGINT, SIG_IGN, SA_RESTART); diff --git a/src/mem.cc b/src/mem.cc index 0d360fe9be..fec63c764d 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.42 1999/05/03 21:55:02 wessels Exp $ + * $Id: mem.cc,v 1.43 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/mime.cc b/src/mime.cc index d6edbf5e39..2bf36bc1e9 100644 --- a/src/mime.cc +++ b/src/mime.cc @@ -1,6 +1,6 @@ /* - * $Id: mime.cc,v 1.92 1999/07/05 21:40:08 wessels Exp $ + * $Id: mime.cc,v 1.93 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 25 MIME Parsing * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/multicast.cc b/src/multicast.cc index 60ebacda85..62e0af2028 100644 --- a/src/multicast.cc +++ b/src/multicast.cc @@ -1,6 +1,6 @@ /* - * $Id: multicast.cc,v 1.7 1998/07/22 20:37:36 wessels Exp $ + * $Id: multicast.cc,v 1.8 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 7 Multicast * AUTHOR: Martin Hamilton @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/neighbors.cc b/src/neighbors.cc index ca0bec7175..297bf07471 100644 --- a/src/neighbors.cc +++ b/src/neighbors.cc @@ -1,6 +1,6 @@ /* - * $Id: neighbors.cc,v 1.277 1999/12/30 17:36:43 wessels Exp $ + * $Id: neighbors.cc,v 1.278 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 15 Neighbor Routines * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/net_db.cc b/src/net_db.cc index bf32c63eef..51ffb890e2 100644 --- a/src/net_db.cc +++ b/src/net_db.cc @@ -1,6 +1,6 @@ /* - * $Id: net_db.cc,v 1.141 1999/12/30 17:36:44 wessels Exp $ + * $Id: net_db.cc,v 1.142 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 38 Network Measurement Database * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/pconn.cc b/src/pconn.cc index 2ecbec8857..c2226323a5 100644 --- a/src/pconn.cc +++ b/src/pconn.cc @@ -1,6 +1,6 @@ /* - * $Id: pconn.cc,v 1.25 1999/01/14 23:15:43 wessels Exp $ + * $Id: pconn.cc,v 1.26 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 48 Persistent Connections * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/peer_digest.cc b/src/peer_digest.cc index 7d92a972a4..17fbc8b1e6 100644 --- a/src/peer_digest.cc +++ b/src/peer_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: peer_digest.cc,v 1.72 1999/12/30 17:36:45 wessels Exp $ + * $Id: peer_digest.cc,v 1.73 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 72 Peer Digest Routines * AUTHOR: Alex Rousskov @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/peer_select.cc b/src/peer_select.cc index 1be75ce945..435e60c22c 100644 --- a/src/peer_select.cc +++ b/src/peer_select.cc @@ -1,6 +1,6 @@ /* - * $Id: peer_select.cc,v 1.104 2000/01/05 23:32:20 wessels Exp $ + * $Id: peer_select.cc,v 1.105 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 44 Peer Selection Algorithm * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/pinger.cc b/src/pinger.cc index 05c72f101a..4f39b48118 100644 --- a/src/pinger.cc +++ b/src/pinger.cc @@ -1,6 +1,6 @@ /* - * $Id: pinger.cc,v 1.42 1999/05/04 21:58:30 wessels Exp $ + * $Id: pinger.cc,v 1.43 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 42 ICMP Pinger program * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/protos.h b/src/protos.h index 919544238d..78efbff309 100644 --- a/src/protos.h +++ b/src/protos.h @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.354 2000/01/14 08:37:07 wessels Exp $ + * $Id: protos.h,v 1.355 2000/03/06 16:23:33 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -374,6 +374,7 @@ extern HttpHeaderFieldInfo *httpHeaderBuildFieldsInfo(const HttpHeaderFieldAttrs extern void httpHeaderDestroyFieldsInfo(HttpHeaderFieldInfo * info, int count); extern int httpHeaderIdByName(const char *name, int name_len, const HttpHeaderFieldInfo * attrs, int end); extern int httpHeaderIdByNameDef(const char *name, int name_len); +extern const char *httpHeaderNameById(int id); extern void httpHeaderMaskInit(HttpHeaderMask * mask, int value); extern void httpHeaderCalcMask(HttpHeaderMask * mask, const int *enums, int count); extern int httpHeaderHasConnDir(const HttpHeader * hdr, const char *directive); diff --git a/src/recv-announce.cc b/src/recv-announce.cc index 5a3e905816..e99ef73ff0 100644 --- a/src/recv-announce.cc +++ b/src/recv-announce.cc @@ -1,7 +1,7 @@ /* - * $Id: recv-announce.cc,v 1.20 1998/07/22 20:37:43 wessels Exp $ + * $Id: recv-announce.cc,v 1.21 2000/03/06 16:23:33 wessels Exp $ * * DEBUG: section 0 Announcement Server * AUTHOR: Harvest Derived @@ -13,10 +13,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/redirect.cc b/src/redirect.cc index 63b5985580..3e89d1a6be 100644 --- a/src/redirect.cc +++ b/src/redirect.cc @@ -1,6 +1,6 @@ /* - * $Id: redirect.cc,v 1.83 1999/12/30 17:36:48 wessels Exp $ + * $Id: redirect.cc,v 1.84 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 29 Redirector * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -108,6 +108,7 @@ redirectStart(clientHttpRequest * http, RH * handler, void *data) memset(&ch, '\0', sizeof(ch)); ch.src_addr = http->conn->peer.sin_addr; ch.my_addr = http->conn->me.sin_addr; + ch.my_port = ntohs(http->conn->me.sin_port); ch.request = http->request; if (!aclCheckFast(Config.accessList.redirector, &ch)) { /* denied -- bypass redirector */ diff --git a/src/refresh.cc b/src/refresh.cc index 2bc5e76389..356094a6f7 100644 --- a/src/refresh.cc +++ b/src/refresh.cc @@ -1,7 +1,7 @@ /* - * $Id: refresh.cc,v 1.50 1999/10/04 05:05:24 wessels Exp $ + * $Id: refresh.cc,v 1.51 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 22 Refresh Calculation * AUTHOR: Harvest Derived @@ -13,10 +13,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/send-announce.cc b/src/send-announce.cc index 2fbcd397bf..1317386681 100644 --- a/src/send-announce.cc +++ b/src/send-announce.cc @@ -1,6 +1,6 @@ /* - * $Id: send-announce.cc,v 1.57 1999/12/30 17:36:49 wessels Exp $ + * $Id: send-announce.cc,v 1.58 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 27 Cache Announcer * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/snmp_agent.cc b/src/snmp_agent.cc index 9aac952b8c..a630752926 100644 --- a/src/snmp_agent.cc +++ b/src/snmp_agent.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_agent.cc,v 1.72 1999/10/04 05:05:25 wessels Exp $ + * $Id: snmp_agent.cc,v 1.73 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 49 SNMP Interface * AUTHOR: Kostas Anagnostakis @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/snmp_core.cc b/src/snmp_core.cc index 544f2fa436..a0b2bc713d 100644 --- a/src/snmp_core.cc +++ b/src/snmp_core.cc @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.cc,v 1.40 1999/10/04 05:05:26 wessels Exp $ + * $Id: snmp_core.cc,v 1.41 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/squid.h b/src/squid.h index 8d114ddea6..ca258172c1 100644 --- a/src/squid.h +++ b/src/squid.h @@ -1,6 +1,6 @@ /* - * $Id: squid.h,v 1.198 2000/01/05 06:23:46 wessels Exp $ + * $Id: squid.h,v 1.199 2000/03/06 16:23:34 wessels Exp $ * * AUTHOR: Duane Wessels * @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/ssl.cc b/src/ssl.cc index 94c2e1f1a0..67c39e9324 100644 --- a/src/ssl.cc +++ b/src/ssl.cc @@ -1,6 +1,6 @@ /* - * $Id: ssl.cc,v 1.101 1999/12/30 17:36:51 wessels Exp $ + * $Id: ssl.cc,v 1.102 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/stat.cc b/src/stat.cc index 5e9ef651ec..9637c962f2 100644 --- a/src/stat.cc +++ b/src/stat.cc @@ -1,6 +1,6 @@ /* - * $Id: stat.cc,v 1.323 2000/01/05 22:44:02 wessels Exp $ + * $Id: stat.cc,v 1.324 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 18 Cache Manager Statistics * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/stmem.cc b/src/stmem.cc index 9e4cace2a0..31cb87cb4a 100644 --- a/src/stmem.cc +++ b/src/stmem.cc @@ -1,6 +1,6 @@ /* - * $Id: stmem.cc,v 1.64 1998/12/05 00:54:42 wessels Exp $ + * $Id: stmem.cc,v 1.65 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 19 Store Memory Primitives * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store.cc b/src/store.cc index 06ee5927f9..6556127e6f 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1,6 +1,6 @@ /* - * $Id: store.cc,v 1.514 2000/02/01 05:43:02 wessels Exp $ + * $Id: store.cc,v 1.515 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1254,9 +1254,24 @@ storeTimestampsSet(StoreEntry * entry) { const HttpReply *reply = entry->mem_obj->reply; time_t served_date = reply->date; + int age = httpHeaderGetInt(&reply->header, HDR_AGE); + /* + * The timestamp calculations below tries to mimic the properties + * of the age calculation in RFC2616 section 13.2.3. The implementaion + * isn't complete, and the most notable exception from the RFC is that + * this does not account for response_delay, but it probably does + * not matter much as this is calculated immediately when the headers + * are received, not when the whole response has been received. + */ /* make sure that 0 <= served_date <= squid_curtime */ if (served_date < 0 || served_date > squid_curtime) served_date = squid_curtime; + /* + * Compensate with Age header if origin server clock is ahead of us + * and there is a cache in between us and the origin server + */ + if (age > squid_curtime - served_date) + served_date = squid_curtime - age; entry->expires = reply->expires; entry->lastmod = reply->last_modified; entry->timestamp = served_date; diff --git a/src/store_client.cc b/src/store_client.cc index 54e6e740a7..781deb2977 100644 --- a/src/store_client.cc +++ b/src/store_client.cc @@ -1,6 +1,6 @@ /* - * $Id: store_client.cc,v 1.83 2000/01/14 18:33:40 wessels Exp $ + * $Id: store_client.cc,v 1.84 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager Client-Side Interface * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -384,12 +384,12 @@ storeClientReadHeader(void *data, const char *buf, ssize_t len) tlv_list = storeSwapMetaUnpack(buf, &swap_hdr_sz); if (swap_hdr_sz > len) { /* oops, bad disk file? */ - debug(20, 1) ("storeClientReadHeader: header too small\n"); + debug(20, 1) ("WARNING: swapfile header too small\n"); storeClientCallback(sc, -1); return; } if (tlv_list == NULL) { - debug(20, 1) ("storeClientReadHeader: failed to unpack meta data\n"); + debug(20, 1) ("WRNING: failed to unpack meta data\n"); storeClientCallback(sc, -1); return; } diff --git a/src/store_digest.cc b/src/store_digest.cc index 282a66511e..eab7d0c60f 100644 --- a/src/store_digest.cc +++ b/src/store_digest.cc @@ -1,5 +1,5 @@ /* - * $Id: store_digest.cc,v 1.37 2000/01/14 07:24:48 wessels Exp $ + * $Id: store_digest.cc,v 1.38 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 71 Store Digest Manager * AUTHOR: Alex Rousskov @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_dir.cc b/src/store_dir.cc index 06362d7b60..ad2d9a7889 100644 --- a/src/store_dir.cc +++ b/src/store_dir.cc @@ -1,6 +1,6 @@ /* - * $Id: store_dir.cc,v 1.104 2000/01/14 07:14:12 wessels Exp $ + * $Id: store_dir.cc,v 1.105 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 47 Store Directory Routines * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_key_md5.cc b/src/store_key_md5.cc index d0d4ea344e..908da4e9cf 100644 --- a/src/store_key_md5.cc +++ b/src/store_key_md5.cc @@ -1,6 +1,6 @@ /* - * $Id: store_key_md5.cc,v 1.22 1999/12/11 15:57:42 wessels Exp $ + * $Id: store_key_md5.cc,v 1.23 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager MD5 Cache Keys * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_log.cc b/src/store_log.cc index 4c68edd6b3..8046820689 100644 --- a/src/store_log.cc +++ b/src/store_log.cc @@ -1,6 +1,6 @@ /* - * $Id: store_log.cc,v 1.9 1999/10/04 05:05:34 wessels Exp $ + * $Id: store_log.cc,v 1.10 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager Logging Functions * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index ce3622f317..a8892cf612 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -1,6 +1,6 @@ /* - * $Id: store_rebuild.cc,v 1.68 2000/02/01 05:45:33 wessels Exp $ + * $Id: store_rebuild.cc,v 1.69 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Store Rebuild Routines * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_swapin.cc b/src/store_swapin.cc index 06aae94e21..8269bc9ab2 100644 --- a/src/store_swapin.cc +++ b/src/store_swapin.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapin.cc,v 1.21 1999/10/04 05:05:34 wessels Exp $ + * $Id: store_swapin.cc,v 1.22 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapin Functions * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_swapmeta.cc b/src/store_swapmeta.cc index 9cbbe9d14a..7a6a3e6ac1 100644 --- a/src/store_swapmeta.cc +++ b/src/store_swapmeta.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapmeta.cc,v 1.9 2000/01/03 19:33:14 wessels Exp $ + * $Id: store_swapmeta.cc,v 1.10 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapfile Metadata * AUTHOR: Kostas Anagnostakis @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/store_swapout.cc b/src/store_swapout.cc index 0115628388..66285c4458 100644 --- a/src/store_swapout.cc +++ b/src/store_swapout.cc @@ -1,6 +1,6 @@ /* - * $Id: store_swapout.cc,v 1.61 2000/02/01 05:52:15 wessels Exp $ + * $Id: store_swapout.cc,v 1.62 2000/03/06 16:23:35 wessels Exp $ * * DEBUG: section 20 Storage Manager Swapout Functions * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/structs.h b/src/structs.h index 7476688ccb..479fec2fe8 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1,6 +1,6 @@ /* - * $Id: structs.h,v 1.312 2000/01/14 08:37:08 wessels Exp $ + * $Id: structs.h,v 1.313 2000/03/06 16:23:36 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -308,13 +308,17 @@ struct _SquidConfig { char *effectiveUser; char *effectiveGroup; struct { +#if USE_DNSSERVER char *dnsserver; +#endif wordlist *redirect; wordlist *authenticate; char *pinger; char *unlinkd; } Program; +#if USE_DNSSERVER int dnsChildren; +#endif int redirectChildren; int authenticateChildren; int authenticateTTL; @@ -378,7 +382,9 @@ struct _SquidConfig { } Netdb; struct { int log_udp; +#if USE_DNSSERVER int res_defnames; +#endif int anonymizer; int client_db; int query_icmp; @@ -404,6 +410,8 @@ struct _SquidConfig { int strip_query_terms; int redirector_bypass; int ignore_unknown_nameservers; + int client_pconns; + int server_pconns; #if USE_CACHE_DIGESTS int digest_generation; #endif @@ -475,12 +483,13 @@ struct _SquidConfig { #endif HttpHeaderMask anonymize_headers; char *coredump_dir; + char *chroot_dir; #if USE_CACHE_DIGESTS struct { int bits_per_entry; - int rebuild_period; - int rewrite_period; - int swapout_chunk_size; + time_t rebuild_period; + time_t rewrite_period; + size_t swapout_chunk_size; int rebuild_chunk_percentage; } digest; #endif diff --git a/src/test_cache_digest.cc b/src/test_cache_digest.cc index 66b7c2d057..3f3d52c3c4 100644 --- a/src/test_cache_digest.cc +++ b/src/test_cache_digest.cc @@ -1,6 +1,6 @@ /* - * $Id: test_cache_digest.cc,v 1.23 1998/07/22 20:38:01 wessels Exp $ + * $Id: test_cache_digest.cc,v 1.24 2000/03/06 16:23:36 wessels Exp $ * * AUTHOR: Alex Rousskov * @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/tools.cc b/src/tools.cc index 1a93a834d5..fb7d384b85 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -1,6 +1,6 @@ /* - * $Id: tools.cc,v 1.188 1999/12/30 17:37:01 wessels Exp $ + * $Id: tools.cc,v 1.189 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -482,6 +482,7 @@ leave_suid(void) { struct passwd *pwd = NULL; struct group *grp = NULL; + gid_t gid; debug(21, 3) ("leave_suid: PID %d called\n", getpid()); if (geteuid() != 0) return; @@ -491,12 +492,15 @@ leave_suid(void) if ((pwd = getpwnam(Config.effectiveUser)) == NULL) return; if (Config.effectiveGroup && (grp = getgrnam(Config.effectiveGroup))) { - if (setgid(grp->gr_gid) < 0) - debug(50, 1) ("leave_suid: setgid: %s\n", xstrerror()); + gid = grp->gr_gid; } else { - if (setgid(pwd->pw_gid) < 0) - debug(50, 1) ("leave_suid: setgid: %s\n", xstrerror()); + gid = pwd->pw_gid; } +#if HAVE_SETGROUPS + setgroups(1, &gid); +#endif + if (setgid(gid) < 0) + debug(50, 1) ("leave_suid: setgid: %s\n", xstrerror()); debug(21, 3) ("leave_suid: PID %d giving up root, becoming '%s'\n", getpid(), pwd->pw_name); #if HAVE_SETRESUID diff --git a/src/tunnel.cc b/src/tunnel.cc index f61b180ea7..ce83f7ab7b 100644 --- a/src/tunnel.cc +++ b/src/tunnel.cc @@ -1,6 +1,6 @@ /* - * $Id: tunnel.cc,v 1.101 1999/12/30 17:36:51 wessels Exp $ + * $Id: tunnel.cc,v 1.102 2000/03/06 16:23:34 wessels Exp $ * * DEBUG: section 26 Secure Sockets Layer Proxy * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/typedefs.h b/src/typedefs.h index 421c92b56c..8e289d18b8 100644 --- a/src/typedefs.h +++ b/src/typedefs.h @@ -1,6 +1,6 @@ /* - * $Id: typedefs.h,v 1.99 1999/12/30 17:37:02 wessels Exp $ + * $Id: typedefs.h,v 1.100 2000/03/06 16:23:36 wessels Exp $ * * * SQUID Internet Object Cache http://squid.nlanr.net/Squid/ @@ -10,10 +10,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/unlinkd.cc b/src/unlinkd.cc index b35921241d..dd25a69a6a 100644 --- a/src/unlinkd.cc +++ b/src/unlinkd.cc @@ -1,5 +1,5 @@ /* - * $Id: unlinkd.cc,v 1.33 1999/12/30 17:37:03 wessels Exp $ + * $Id: unlinkd.cc,v 1.34 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 12 Unlink Daemon * AUTHOR: Duane Wessels @@ -11,10 +11,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/url.cc b/src/url.cc index 93b0e4887a..dc7d2f7396 100644 --- a/src/url.cc +++ b/src/url.cc @@ -1,6 +1,6 @@ /* - * $Id: url.cc,v 1.120 1999/12/30 17:37:03 wessels Exp $ + * $Id: url.cc,v 1.121 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 23 URL Parsing * AUTHOR: Duane Wessels @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/urn.cc b/src/urn.cc index 7f0b685219..ebbd390579 100644 --- a/src/urn.cc +++ b/src/urn.cc @@ -1,7 +1,7 @@ /* * - * $Id: urn.cc,v 1.57 1999/12/30 17:37:04 wessels Exp $ + * $Id: urn.cc,v 1.58 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 52 URN Parsing * AUTHOR: Kostas Anagnostakis @@ -13,10 +13,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/useragent.cc b/src/useragent.cc index 9037b50383..8a8374b707 100644 --- a/src/useragent.cc +++ b/src/useragent.cc @@ -1,6 +1,6 @@ /* - * $Id: useragent.cc,v 1.18 1999/08/02 06:18:50 wessels Exp $ + * $Id: useragent.cc,v 1.19 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 40 User-Agent logging * AUTHOR: Joe Ramey @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/wais.cc b/src/wais.cc index ec383539b2..ddf82afde1 100644 --- a/src/wais.cc +++ b/src/wais.cc @@ -1,6 +1,6 @@ /* - * $Id: wais.cc,v 1.131 1999/01/24 02:26:26 wessels Exp $ + * $Id: wais.cc,v 1.132 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 24 WAIS Relay * AUTHOR: Harvest Derived @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/src/wccp.cc b/src/wccp.cc index 7d631e762b..326985a12d 100644 --- a/src/wccp.cc +++ b/src/wccp.cc @@ -1,6 +1,6 @@ /* - * $Id: wccp.cc,v 1.13 2000/01/14 07:13:16 wessels Exp $ + * $Id: wccp.cc,v 1.14 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 80 WCCP Support * AUTHOR: Glenn Chisholm @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -265,7 +265,7 @@ wccpHereIam(void *voidnotused) wccp_here_i_am.id = wccp_i_see_you.id; send(theOutWccpConnection, - (void *) &wccp_here_i_am, + &wccp_here_i_am, sizeof(wccp_here_i_am), 0); diff --git a/src/whois.cc b/src/whois.cc index 5fb184a599..133296bddf 100644 --- a/src/whois.cc +++ b/src/whois.cc @@ -1,6 +1,6 @@ /* - * $Id: whois.cc,v 1.9 1999/01/15 06:11:47 wessels Exp $ + * $Id: whois.cc,v 1.10 2000/03/06 16:23:36 wessels Exp $ * * DEBUG: section 75 WHOIS protocol * AUTHOR: Duane Wessels, Kostas Anagnostakis @@ -12,10 +12,10 @@ * Internet community. Development is led by Duane Wessels of the * National Laboratory for Applied Network Research and funded by the * National Science Foundation. Squid is Copyrighted (C) 1998 by - * Duane Wessels and the University of California San Diego. Please - * see the COPYRIGHT file for full details. Squid incorporates - * software developed and/or copyrighted by other sources. Please see - * the CREDITS file for full details. + * the Regents of the University of California. Please see the + * COPYRIGHT file for full details. Squid incorporates software + * developed and/or copyrighted by other sources. Please see the + * CREDITS file for full details. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by