]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
14 years agoBug 3151: squid_kerb_auth: use autoconf LIBS instead of FLAGS for library linkage
Amos Jeffries [Sun, 13 Feb 2011 10:54:10 +0000 (23:54 +1300)] 
Bug 3151: squid_kerb_auth: use autoconf LIBS instead of FLAGS for library linkage

Older gcc accept library -l details in several wrong places.
gcc 4.5 will fail to build if they are not in the right section.

14 years agoPrevent CONNECT request relaying to origin servers
Amos Jeffries [Fri, 11 Feb 2011 20:20:12 +0000 (13:20 -0700)] 
Prevent CONNECT request relaying to origin servers

CONNECT requests are proxy requests not to be forwarded to origins

14 years agoHandle HTCP read failures and small packets.
Amos Jeffries [Fri, 11 Feb 2011 20:19:28 +0000 (13:19 -0700)] 
Handle HTCP read failures and small packets.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 8 Feb 2011 05:29:45 +0000 (22:29 -0700)] 
SourceFormat Enforcement

14 years ago3.1.11 SQUID_3_1_11
Amos Jeffries [Tue, 8 Feb 2011 04:05:03 +0000 (17:05 +1300)] 
3.1.11

14 years agoAuthor: D Kazarov <d.y.kazarov@mail.ru>
Amos Jeffries [Mon, 7 Feb 2011 12:21:27 +0000 (05:21 -0700)] 
Author: D Kazarov <d.y.kazarov@mail.ru>
Bug 3137: RADIUS auth helper does not send identifier to RADIUS server

14 years agoAuthor: Phil Oester <kernel@linuxace.com>
Amos Jeffries [Mon, 7 Feb 2011 12:19:41 +0000 (05:19 -0700)] 
Author: Phil Oester <kernel@linuxace.com>
Bug 3115: logging segfaults if access_log is set to a directory

14 years agoAuthor: Jonathan Wolfe <jonathan.wolfe@gmail.com>
Amos Jeffries [Mon, 7 Feb 2011 12:16:27 +0000 (05:16 -0700)] 
Author: Jonathan Wolfe <jonathan.wolfe@gmail.com>
Bug 3149: not caching ecap adapted body

eCAP adapters may remove or edit the Content-Length header, and to allow
caching of the adapted body squid must reflect that new (or unspecified)
content length when deciding whether or not the adapted body can be cached.

14 years agoPrevent pipeline_prefetch misconfigurations
Amos Jeffries [Mon, 7 Feb 2011 12:15:24 +0000 (05:15 -0700)] 
Prevent pipeline_prefetch misconfigurations

Enact the TODO/Caveat about checking post-parse for auth type clashing
with pipeline settings. This can only fix local configuration errors.

Pipeline_prefetch ON will still silently break WWW-Authenticate pass-thru
and Proxy-Authenticate pass-thru for these auth mechanisms.

14 years agoAuthor: Alexandre SIMON <alexandre.simon@ciril.fr>
Amos Jeffries [Mon, 7 Feb 2011 12:07:18 +0000 (05:07 -0700)] 
Author: Alexandre SIMON <alexandre.simon@ciril.fr>
Bug 3144: redirector program blocks while reading STDIN

The string passed to redirect helper program may exceed the available
buffer space and be truncated. Thus having no \n terminator for the helper.

Test for this failure condition and produce an error page.

14 years agoDocumentation: various squid.conf updates
Amos Jeffries [Tue, 1 Feb 2011 02:38:37 +0000 (19:38 -0700)] 
Documentation: various squid.conf updates

* maxconn ACL applies only on direct client IPs

* Updated IPv6 magic tcp_outgoing_address example

14 years agoAuthor: Steven Lawrance <squid@moonlightdesign.org>
Amos Jeffries [Tue, 1 Feb 2011 02:32:59 +0000 (19:32 -0700)] 
Author: Steven Lawrance <squid@moonlightdesign.org>
Bug 2968: Show the Vary: headers information in cachemgr objects report

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Tue, 1 Feb 2011 02:31:49 +0000 (19:31 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Fix IP/FQDN cache accounting to avoid idle caches on busy servers.

When maintaining the IP/FQDN cache size, use the number of entries in the cache
rather than the number of allocated and not freed MEM_IPCACHE_ENTRY and
MEM_FQDNCACHE_ENTRY objects. These objects are used outside the cache
for DNS queries. If queries leak (or perhaps when there are just a lot of them),
the memory-pool-based count overestimates the cache size, sometimes to
such a degree that the cache remains nearly empty despite lots of misses.

Use memory-pool-based counter to estimate cache size also violates IP/FQDN cache
encapsulation boundaries because it effectively prevents others from using
the same memory pool.

14 years agoAuthor: Francesco Chemolli <kinkie@squid-cache.org>
Amos Jeffries [Tue, 1 Feb 2011 02:20:32 +0000 (19:20 -0700)] 
Author: Francesco Chemolli <kinkie@squid-cache.org>
Bug 2868: icc doesn't like string literal in assert checks

14 years agoAuthor: Fabian Hugelshofer <fh@open.ch>
Amos Jeffries [Tue, 1 Feb 2011 02:17:05 +0000 (19:17 -0700)] 
Author: Fabian Hugelshofer <fh@open.ch>
Allow persistent connections for Mozilla/3.0 User-Agents

This fixes NTLM and Negotiate authentication for these agents.

History:

In 1998 a hack was added to HttpMsg::persistent() that disables
persistent connections for HTTP/1.0 User-Agents starting with
"Mozilla/3." and "Netscape/3.".

According to the thread on squid-dev
(http://www.eu.squid-cache.org/mail-archive/squid-dev/199805/0087.html),
this was necessary to make some versions of Netscape browsers work that
had a broken implementation of persistent connections. It was said that
"NS 3.01 is ok. NS 3.02 is bad. NS 3.04 is good." Netscape 4 was ok, too.

14 years agoFix external_acl_type grace= option
Amos Jeffries [Tue, 1 Feb 2011 02:15:16 +0000 (19:15 -0700)] 
Fix external_acl_type grace= option

Due to race conditions between concurrent requests this is still not a
complete fix. But reduces the unwanted re-use of helper responses from
all connections arriving in a whole second which match the ACL key down
to just those that arrive within the reply lag time of the helper.

The grace option has a resolution of 1 second.

14 years agoAuthor: Martin Huter <mhuter@barracuda.com>
Amos Jeffries [Tue, 1 Feb 2011 01:55:04 +0000 (18:55 -0700)] 
Author: Martin Huter <mhuter@barracuda.com>
Bug 3140: memory leak in error page generation

14 years agoAuthor: Henrik Nordstrom <henrik@henriknordstrom.net>
Amos Jeffries [Tue, 1 Feb 2011 01:50:29 +0000 (18:50 -0700)] 
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
Simplify request parsing to not check request method when determining entities

Requests containing a request-entity or not is signalled entirely by
Content-Length/Transfer-Encoding regardless of method.

Also drops the requirement that PUT/POST requests must have a request-entity.
The RFC do not explicitly state this requirement even if the wording for those
methods do assume there is a enclosed request-entity.

The administrative "request_entities" config flag is kept for security
reasons, even if not really RFC compliant. (RFC meaning of request-entity
in GET/HEAD is just undefined or "ignored", not forbidden)

14 years agoFix broken cfgman links on obsolete directives
Amos Jeffries [Tue, 1 Feb 2011 01:48:29 +0000 (18:48 -0700)] 
Fix broken cfgman links on obsolete directives

14 years agoFix Solaris getrusage wrapping
Amos Jeffries [Tue, 1 Feb 2011 01:47:36 +0000 (18:47 -0700)] 
Fix Solaris getrusage wrapping

14 years agoftp_eprt directive to disable EPRT extensions in FTP
Amos Jeffries [Tue, 1 Feb 2011 01:37:14 +0000 (18:37 -0700)] 
ftp_eprt directive to disable EPRT extensions in FTP

This allows admin to resolve compatibility problems with old devices which
encounter a range of problems when FTP extensions are used by selectively
disabling any of the extensions individually.

The other EPSV extensions already have enable/disable directives.

14 years agoBug 2959: remove SAMBAPREFIX dependency
Amos Jeffries [Tue, 1 Feb 2011 01:33:52 +0000 (18:33 -0700)] 
Bug 2959: remove SAMBAPREFIX dependency

This removes the tricky SAMBAPREFIX variable which passes full-path
information from the squid build machine down to the run-time host
helper.

Such information is not always correct when crossing machines, and the
binaries being run can easily be added to PATH in the run-time host
environment instead.

The net result of doing this is removal of Samba from the build
dependencies and increased availability of the smb_auth and
wbinfo_group.pl helpers.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Tue, 1 Feb 2011 01:21:41 +0000 (18:21 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Fixed typo in unused(?) HttpHeader::putSc() method. Range header was deleted.

14 years agoFix mangled ESI configure logics
Amos Jeffries [Mon, 31 Jan 2011 01:10:17 +0000 (18:10 -0700)] 
Fix mangled ESI configure logics

14 years agoAuthor: Francesco Chemolli <kinkie@squid-cache.org>
Amos Jeffries [Sun, 30 Jan 2011 05:46:41 +0000 (22:46 -0700)] 
Author: Francesco Chemolli <kinkie@squid-cache.org>
Standard compliance fix: size_t is guaranteed unsigned

14 years agoCompat: static functions cannot be passed externally with some compilers
Amos Jeffries [Sun, 30 Jan 2011 05:24:12 +0000 (22:24 -0700)] 
Compat: static functions cannot be passed externally with some compilers

Solaris StudioCC, HPUX and old GCC complain about statics being passed
by pointers outside the current file.
Elected to drop 'static' instead of adding a bunch of specific wrapper hacks.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sun, 30 Jan 2011 05:20:41 +0000 (22:20 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Handle early eCAP transaction failures better.

Do not throw an exception if eCAP transaction had to deal with a virgin body
but was not consuming it at swangSong() time. This may happen if the eCAP
adapter throws an exception before the adapter requests the virgin body
transmission or after it stops the transmission. In other words, the
transaction wrapper consumes only if proxyingVb is on.

14 years agoFreeBSD: locate packages under /usr/local
Amos Jeffries [Sun, 30 Jan 2011 05:12:25 +0000 (22:12 -0700)] 
FreeBSD: locate packages under /usr/local

14 years agoHTTP/1.1 support: Send 307 status on deny_info redirection
Amos Jeffries [Fri, 14 Jan 2011 06:30:28 +0000 (23:30 -0700)] 
HTTP/1.1 support: Send 307 status on deny_info redirection

This makes Squid send an HTTP/1.1 307 status response to 1.1+ clients if
the deny_info directive is used to redirect non-GET/HEAD requests.

Current behaviour is to use a 302, which browsers will prevent
displaying for security protection against injection attacks. Using 307
will give browsers a better chance to identify the redirects and handle
them safely.

14 years agoAuthor: Henrik Nordstrom <hno@squid-cache.org>
Amos Jeffries [Fri, 14 Jan 2011 05:02:13 +0000 (22:02 -0700)] 
Author: Henrik Nordstrom <hno@squid-cache.org>
Support RFC 5861 Cache-Control: stale-if-error option

The default behaviour for Squid is to present the stale object when
revalidation fails with a 5xx error.

stale-if-error places a maximum limit on how long this stale object may
be sent. After the limit has passed Squid is required to present the 5xx
message to the client.

Original code for Squid-2 was sponsored by Yahoo!.

Portage done by Alex Rousskov and Amos Jeffries.

14 years ago3.1.10 SQUID_3_1_10
Amos Jeffries [Wed, 22 Dec 2010 05:46:16 +0000 (22:46 -0700)] 
3.1.10

14 years agoPrep for 3.1.10
Amos Jeffries [Wed, 22 Dec 2010 05:44:56 +0000 (18:44 +1300)] 
Prep for 3.1.10

14 years agoFreeBSD: locate packages under /usr/local
Amos Jeffries [Wed, 22 Dec 2010 05:38:22 +0000 (22:38 -0700)] 
FreeBSD: locate packages under /usr/local

14 years agoAuthor: Francesco Chemolli <kinkie@squid-cache.org>
Amos Jeffries [Tue, 21 Dec 2010 15:09:15 +0000 (08:09 -0700)] 
Author: Francesco Chemolli <kinkie@squid-cache.org>
Port from 3.2: simplified OS host and version detection

* part of the configure upgrade. These variables are used by some features now.
  This makes backporting simpler.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 21 Dec 2010 10:32:24 +0000 (03:32 -0700)] 
SourceFormat Enforcement

14 years agosquid_opt_* do not exist in 3.1
Amos Jeffries [Tue, 21 Dec 2010 07:12:02 +0000 (00:12 -0700)] 
squid_opt_* do not exist in 3.1

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Tue, 21 Dec 2010 00:53:56 +0000 (17:53 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Avoid comm_read "!fd_table[fd].closing()" assertion after adaptation ACL check

The assertion was hit if Server fd was closed while we were checking
adaptation ACLs, and we have not been notified of the closure yet (because the
Adaptation::AccessCheck callback is not async while closure notification is).

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Tue, 21 Dec 2010 00:52:56 +0000 (17:52 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Polished HttpStateData::persistentConnStatus() code. No functionality changes.

Do not check for flags.headers_parsed. The removed check was:
 - misplaced: connection-related conditions such as eof must be checked first;
 - wasteful: we never call persistentConnStatus() unless we parsed headers.

Moreover, calling persistentConnStatus() before we parse headers would trigger
and assertion because the method uses virginReply() which does not exist until
the headers are parsed.

Moved virginReply() call closer to the first virgin reply use. This will help
re-adding "did we parse the header yet" check if we ever need it again. It
also saves a couple of CPU cycles for some transactions.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Tue, 21 Dec 2010 00:43:53 +0000 (17:43 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
TestBed: Prevent "chmod: cannot access btlayer..." errors during build tests.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Tue, 21 Dec 2010 00:42:37 +0000 (17:42 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Prevent memory leaks when Adaptation::AccessCheck callback ends the job.

The AccessCheckCallbackWrapper is used in nonBlockingCheck() and is called
from the ACL code, using legacy function-based API.  If the job ends during
the callback processing, there are no AsyncCall wrappers to destroy the job
object. We now convert legacy to async call to enable proper wrapping and job
destruction.

These kind of job leaks are invisible to valgrind, but that is another bug.

14 years agoFreeBSD 7.x required for pthreads support
Amos Jeffries [Tue, 21 Dec 2010 00:34:49 +0000 (17:34 -0700)] 
FreeBSD 7.x required for pthreads support

This only looks at the first byte of the numeric version. So will break
when 10.* is released. However 6.* should be dead by then.

14 years agoDocumentation clarification
Amos Jeffries [Tue, 21 Dec 2010 00:03:44 +0000 (17:03 -0700)] 
Documentation clarification

14 years agoFix cachemgr http_port config report hiding options
Amos Jeffries [Mon, 20 Dec 2010 23:55:06 +0000 (16:55 -0700)] 
Fix cachemgr http_port config report hiding options

14 years agoReduce debug level on bodypipe re-write change
Amos Jeffries [Mon, 20 Dec 2010 23:44:21 +0000 (16:44 -0700)] 
Reduce debug level on bodypipe re-write change

- the original reason for adding is unknown
- it is an annoyance for some
- there have been no big problems tracked down to this bodypipe change
  over the last few years. It appears relatively harmless.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Mon, 20 Dec 2010 13:37:07 +0000 (06:37 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Author: Dmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Bug 427: HTTP Compliance: Support If-Match and If-None-Match requests.

Add support for If-Match and If-None-Match headers as described in RFC 2616
(sections 14.24 and 14.26 in particular).

Moved IMS handling from clientReplyContext::cacheHit() to
clientReplyContext::processConditional() while preserving the original IMS
logic, except for the case when a request has both IMS and If-None-Match.

Co-Advisors test cases:
    test_clause/rfc2616/ifMatch-mismatch-strong
    test_clause/rfc2616/ifMatch-mismatch-weak
    test_clause/rfc2616/ifNoneMatch-match-imsNone
    and many more

14 years agoBug 3113: additional: handleRequestBodyData must return false on closure.
Amos Jeffries [Mon, 20 Dec 2010 11:41:54 +0000 (04:41 -0700)] 
Bug 3113: additional: handleRequestBodyData must return false on closure.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Mon, 20 Dec 2010 06:12:57 +0000 (23:12 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP/1.1: do not forward TRACE with Max-Forwards: 0 after REQMOD

Before the change, Max-Forwards request value was cached in
HttpRequest::max_forwards member. It was set once in
clientProcessRequest() function. This works fine as long as no request
adaptation is performed. Otherwise original HTTP request may be
replaced with adopted one in ClientHttpRequest::noteAdaptationAnswer()
method and max_forwards value is lost.

This change removes HttpRequest::max_forwards member and gets the value
directly from HttpHeader when needed. This adds another string-to-int
conversion for TRACE and OPTIONS requests, but those are rare, and we
save a little in the other, far more common cases by removing the
HttpRequest::max_forwards member.

Removed assertion from clientReplyContext::traceReply() since it is
called from a single place and the condition is checked right before
the call.

Co-Advisors test cases:
    test_case/rfc2616/maxForwardsZero-TRACE-asterisk
    test_case/rfc2616/maxForwardsZero-TRACE-absolute

14 years agoeCAP: cache.log polish
Amos Jeffries [Mon, 20 Dec 2010 05:39:01 +0000 (22:39 -0700)] 
eCAP: cache.log polish

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Mon, 20 Dec 2010 05:06:52 +0000 (22:06 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Added missing status phrase to some 304 (Not Modified) replies.

The bug affected 304 hits, at least.

14 years agoSolaris: base system lacks paths.h system definitions
Amos Jeffries [Mon, 20 Dec 2010 05:05:02 +0000 (22:05 -0700)] 
Solaris: base system lacks paths.h system definitions

14 years agoAuthor: Henrik Nordstrom <henrik@henriknordstrom.net>
Amos Jeffries [Mon, 20 Dec 2010 04:55:46 +0000 (21:55 -0700)] 
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
Correct ESI processing condition. Need to look for parsed header, not the header mask (filtered)

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Mon, 20 Dec 2010 04:55:04 +0000 (21:55 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Added debugging to the "client-max-age = 0 and ignore-reload" freshness check.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Mon, 20 Dec 2010 04:53:23 +0000 (21:53 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: entry is stale if request has max-age=0.

We should always do validation for requests with Cache-Control max-age=0,
even when entry age is also zero. In our case, RFC 2616 says:

    freshness_lifetime = max_age_value
    response_is_fresh = (freshness_lifetime > current_age)

and response_is_fresh is always false if freshness_lifetime is zero.

The check code was introduced in r5998 with a "Import of fix-ranges
branch" message. The code was commented out at the time of that
commit, for reasons unknown.

Test case:
    test_case/rfc2616/noSrv-hit-stale-max-age-req

14 years agoAuthor: Hank Hampel <hh@nr-city.net>
Amos Jeffries [Mon, 20 Dec 2010 04:50:28 +0000 (21:50 -0700)] 
Author: Hank Hampel <hh@nr-city.net>
Bug 3028: Permit wbinfo_group.pl to authenticate Kerberos users with NT domain

14 years agoPortage amendments to obsoletion processing
Amos Jeffries [Mon, 20 Dec 2010 04:41:39 +0000 (21:41 -0700)] 
Portage amendments to obsoletion processing

14 years agoAuthor: Henrik Nordstrom <henrik@henriknordstrom.net>
Amos Jeffries [Sat, 18 Dec 2010 12:46:13 +0000 (05:46 -0700)] 
Author: Henrik Nordstrom <henrik@henriknordstrom.net>
Make bootstrap.sh use system default autotools versions instead of searching

- can be overridden on commandline if needed. See bootstrap.sh for details.
- Update autoconf to 2.68
- Rename configure.ac to match current autotools standards

14 years agoAuthor: Various Translators
Amos Jeffries [Fri, 17 Dec 2010 19:59:24 +0000 (12:59 -0700)] 
Author: Various Translators
Sync translations from 3.HEAD

14 years agoSupport RFC 2965 Set-Cookie2 / Cookie2 headers
Amos Jeffries [Fri, 17 Dec 2010 19:54:50 +0000 (12:54 -0700)] 
Support RFC 2965 Set-Cookie2 / Cookie2 headers

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Fri, 17 Dec 2010 19:49:54 +0000 (12:49 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Fixed DEFAULT_PID_FILE typo to fix "var/run" creation during "make install".

NP: in 3.1 specifically this only affects packages whih patch the PID location

14 years agoUpgrade process for obsolete options
Amos Jeffries [Fri, 17 Dec 2010 19:46:13 +0000 (12:46 -0700)] 
Upgrade process for obsolete options

One problem we currently have with upgrades is leaving the parser able
to avoid its bungled/unknown option message for directives which have
been fully removed or massively syntax altered.

We are able to handle this for flags and option syntax easily but the
parser has been particularly dense and strict on the directives (first
word of each line).

This patch updates the cf_* and cfgman code to allow a special directive
type "obsolete" which causes these directives to be handled specially
without causing the directives to remain in the publicly visible
squid.conf documentation.

It allows DOC_START / DOC_END comments to be written in cf.data.pre
describing the upgrade actions that need to be taken. This text is
dumped to cache.log verbatim when the configuration option is sighted.

If "-k parse" is used the text is displayed at debug level 0, otherwise
displayed at debug level 1. One line indicating a generic "directive X
is obsolete" is always displayed at level 0 for backwards compatibility
with admin expectations of a high level "bungled" message.

After all this text display, parse_obsolete(char*) is called with the
directive name. This function exists in cache_cf.cc and can be coded to
selectivey do more complex handling of the directive. ie for upgrade
actions deeper than removal.

* cf.data.pre has entries added for all the 2.6-3.1 directives I could
   find that were removed.

14 years agoAuthor: Graham Keeling <graham@equiinet.com>
Amos Jeffries [Fri, 17 Dec 2010 18:56:56 +0000 (11:56 -0700)] 
Author: Graham Keeling <graham@equiinet.com>
Bug 3113: Squid can eat far too much memory when uploading files

Problem description:
  Uploading a large file to a web site on the internet, squid's client
input buffer will increase far faster than it can be emptied to
the target website, and the machine will swiftly run out of memory.

This patch adds the client_request_buffer_max_size configuration
parameter  which specifies the maximum buffer size of a client request.

14 years agoAuthor: Frank Schmirler <squid@schmirler.de>
Amos Jeffries [Fri, 10 Dec 2010 01:53:55 +0000 (18:53 -0700)] 
Author: Frank Schmirler <squid@schmirler.de>
Bug 3121: DigestAuth: AuthUser object is locked twice

14 years agoAuthor: Stefan Fritsch <sf@sfritsch.de>
Amos Jeffries [Mon, 6 Dec 2010 02:14:40 +0000 (19:14 -0700)] 
Author: Stefan Fritsch <sf@sfritsch.de>
Bug 3096: Squid destroys CbDataList<DeferredRead> objects too late

When server download speed exceeds client download speed, Squid creates a
CbDataList<DeferredRead> object and associates a comm_close handler with it.
When the server kicks the deferred read, the comm_close handler is canceled.
This create/cancel sequence happens every time the server-side code wants to
read but has to wait for the client, which may happen hundreds of times per
second.

Before this change, those canceled comm_close handlers were not removed from
Comm until the end of the entire server transaction, possibly accumulating
thousands of CbDataList<DeferredRead> objects tied to the socket descriptor
via the canceled but still stored close handler.

comm_remove_close_handler now immediately removes canceled close handlers to
avoid their accumulation.

14 years agoBug 3110: reply_body_max_size none dont work with x-forwarded-for
Amos Jeffries [Sat, 4 Dec 2010 16:28:02 +0000 (09:28 -0700)] 
Bug 3110: reply_body_max_size none dont work with x-forwarded-for

14 years agoBug 3068: cache_dir capacity and usage overflows
Amos Jeffries [Sat, 4 Dec 2010 16:23:14 +0000 (09:23 -0700)] 
Bug 3068: cache_dir capacity and usage overflows

Makes usage calculations use size_t instead of int and updates the
relevant fields storing the cache_dir capacity and usage fields as well.

This fixes Squid filling cache_dir with files >2GB in size.
Also allows Squid to store more than 2TB of data total in one dir.

14 years agoOmit compat/os/ from direct header testing.
Amos Jeffries [Tue, 9 Nov 2010 22:21:42 +0000 (11:21 +1300)] 
Omit compat/os/ from direct header testing.

The structural requirements of compat/ guarantee that they will be tested
wherever needed by indirect inclusion.

This also permits removal of one special-case usage of testHeaders.

14 years agoDist missing opensolaris portability header
Amos Jeffries [Tue, 9 Nov 2010 21:23:19 +0000 (14:23 -0700)] 
Dist missing opensolaris portability header

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sun, 7 Nov 2010 10:04:54 +0000 (03:04 -0700)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Bug 3091: Bypassed ICAP errors are not counted as service failures.

Notify ICAP service about the failure even if we can bypass it. Otherwise,
a failing service may continue to stay "up", preventing Squid from using a
healthy backup alternative in a service_set (or bypassing ICAP completeley).

14 years agoAuthor: Declan White <declanw@is.bbc.co.uk>
Amos Jeffries [Mon, 1 Nov 2010 23:26:02 +0000 (17:26 -0600)] 
Author: Declan White <declanw@is.bbc.co.uk>
Fix /dev/poll and poll() selection priority

14 years agoBug 3090: Polish FTP login error handing
Amos Jeffries [Mon, 1 Nov 2010 05:41:38 +0000 (23:41 -0600)] 
Bug 3090: Polish FTP login error handing

Reverts a regression added recently that blocked the challenge events.
Fixes another potential nul-pointer dereference bug.

* 421/426 server overload equate to HTTP overload. But do special such that
  the credentials are asked of the browser on retries.

* 43x and 53x FTP status are all credentials failures of various types.
  Other failures are not credential related.
  This leaves the other non-credential errors as general failures.

14 years ago3.1.9 SQUID_3_1_9
Amos Jeffries [Mon, 25 Oct 2010 11:33:39 +0000 (05:33 -0600)] 
3.1.9

14 years agoPrep for 3.1.9
Amos Jeffries [Mon, 25 Oct 2010 07:58:26 +0000 (20:58 +1300)] 
Prep for 3.1.9

14 years agoAuthor: Marcin Wisnicki <mwisnicki@gmail.com>
Amos Jeffries [Mon, 25 Oct 2010 06:40:45 +0000 (00:40 -0600)] 
Author: Marcin Wisnicki <mwisnicki@gmail.com>
Bug 3088: dnsserver is segfaulting

14 years agoBug 2808: getRoundRobinParent not handling weights correctly
Amos Jeffries [Mon, 25 Oct 2010 06:38:54 +0000 (00:38 -0600)] 
Bug 2808: getRoundRobinParent not handling weights correctly

Suspected fix. Has not been able to be replicated before the change.

14 years agoBug 2793: memory statistics sometimes display wrong
Amos Jeffries [Mon, 25 Oct 2010 06:38:10 +0000 (00:38 -0600)] 
Bug 2793: memory statistics sometimes display wrong

14 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 24 Oct 2010 15:50:24 +0000 (09:50 -0600)] 
SourceFormat Enforcement

14 years agoUpdate HttpRequest unit tests for 3.1
Amos Jeffries [Sun, 24 Oct 2010 04:51:47 +0000 (22:51 -0600)] 
Update HttpRequest unit tests for 3.1

14 years agoFix alignment mismatch after ports
Amos Jeffries [Sat, 23 Oct 2010 14:53:53 +0000 (08:53 -0600)] 
Fix alignment mismatch after ports

14 years agoAuthor: Adrian Chadd <adri@squid-cache.org>
Amos Jeffries [Sat, 23 Oct 2010 14:46:30 +0000 (08:46 -0600)] 
Author: Adrian Chadd <adri@squid-cache.org>
Author: Peter Payne
Bug 2356: Solaris /dev/poll event ports support.

Original code by Adrian Chadd.
Ported from Squid-2 by Peter Payne, Pirosa Limited UK.

With sponsorship of development and testing from:
  BBC (UK)
  Siemens IT Solutions and Services (UK)

14 years agoBug 3040: Lower-case domain entries from hosts and resolv.conf files
Amos Jeffries [Sat, 23 Oct 2010 14:29:42 +0000 (08:29 -0600)] 
Bug 3040: Lower-case domain entries from hosts and resolv.conf files

14 years agoAuthor: Christophe Saout <christophe@saout.de>
Amos Jeffries [Sat, 23 Oct 2010 13:54:37 +0000 (07:54 -0600)] 
Author: Christophe Saout <christophe@saout.de>
Bug 3084: IPv6 without Host: header in request causes connection to hang

accel and intercept mode URL re-generation used NtoA instead of ToHostname.
This results in the URL incorrectly wrapping the raw-IPv6 and problems
connecting to non-existent addresses in some cases.

14 years agoBug 3082: Typo in error message
Amos Jeffries [Sat, 23 Oct 2010 13:53:20 +0000 (07:53 -0600)] 
Bug 3082: Typo in error message

14 years agoBug 3036: adaptation_access acls cannot see myportname
Amos Jeffries [Sat, 23 Oct 2010 13:52:09 +0000 (07:52 -0600)] 
Bug 3036: adaptation_access acls cannot see myportname

Temporary fix to pass myportname to adaptation_access ACLs.

14 years agoFix idle struct addrinfo definition.
Amos Jeffries [Sat, 23 Oct 2010 13:50:24 +0000 (07:50 -0600)] 
Fix idle struct addrinfo definition.

ai_addrlen is defined formally as socklen_t not size_t. This could have
caused problems if the idle version were ever used.

Found during investigation of bug 3057 by "Anonymous".

14 years agoAuthor: OpenSolaris Project
Amos Jeffries [Sat, 23 Oct 2010 13:49:26 +0000 (07:49 -0600)] 
Author: OpenSolaris Project
Bug 3057: 64-bit Solaris 9 Squid unable to determine peer IP and port

Fix by bundling a cleaner copy by the OpenSolaris authors that contains
backward-compatible fixes for broken Solaris 9 struct addrinfo.

Bundling this header as a full replacement is safer and easier than
hacking around with special struct defines.

14 years agoAuthor: Andrew Beverley <andy@andybev.com>
Amos Jeffries [Sat, 23 Oct 2010 13:46:39 +0000 (07:46 -0600)] 
Author: Andrew Beverley <andy@andybev.com>
Fix variable name clash in heap.c

14 years agoAuthor: Stefan Fritsch <sf@sfritsch.de>
Amos Jeffries [Sat, 23 Oct 2010 13:44:56 +0000 (07:44 -0600)] 
Author: Stefan Fritsch <sf@sfritsch.de>
Bug 3073: tunnelStateFree memory leak of host member

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:43:17 +0000 (07:43 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: do not cache replies to requests with CC/no-store.

Per RFC 2616, do not store any part of response to requests with a no-store
Cache-Control directive.

We may still _serve_ no-store requests from the cache because RFC 2616 does not
seem to prohibit that. This may change if HTTPbis or developers decide to
prohibit no-store hits.

Co-Advisor test case:
    test_case/rfc2616/ccReqDirMsg-no-store-basic

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:42:20 +0000 (07:42 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: reply with 504 (Gateway Timeout) if required validation fails.

RFC 2616 says that we MUST reply with 504 (Gateway Timeout) if validation
fails and cached reply has proxy-revalidate, must-revalidate or s-maxage
Cache-Control directive.

FwdState::makeConnectingError() method is added to set error status depending
on whether the request was a validation request.

Co-Advisor test cases:
    test_case/rfc2616/noSrv-hit-must-reval-s-maxage-resp
    test_case/rfc2616/noSrv-hit-must-reval-proxy-revalidate-resp
    test_case/rfc2616/noSrv-hit-must-reval-must-revalidate-resp

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:41:01 +0000 (07:41 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: support requests with Cache-Control: min-fresh.

Added min-fresh directive support for Cache-Control header. The directive is
handled in refreshCheck() by incrementing age and check_time by min-fresh
value.

Co-Advisor test case:
    test_case/rfc2616/ccReqDirMsg-min-fresh-obey

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:39:03 +0000 (07:39 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: add appropriate Warnings if serving a stale hit.

Per RFC 2616, we MUST add "110 Response is stale" Warning if serving a
stale reply for any reason, including configured overrides. We MUST add
"111 Revalidation failed" Warning if serving a stale reply because an
attempt to revalidate the response failed, due to an inability to reach
the server.

The patch adds a new stale_if_hit request flag, which is set in
refreshCheckHTTP() when entry freshness is calculated. refreshCheckHTTP()
is now called in offline mode, to set stale_if_hit properly. We check for
the offline mode before returning from refreshCheckHTTP() to preserve the
original logic.

refreshCheckHTTP() is no longer called for internal requests, to avoid
setting of stale_if_hit flag. It did not do anything important for
internal requests anyway.

Co-Advisor test cases:
   test_case/rfc2616/noSrv-hit-stale-max-age-req
   test_case/rfc2616/ccReqDirMsg-max-stale-warning

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:36:27 +0000 (07:36 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Accept ICAP OPTIONS responses with unknown body types.

Warn about the unknown OPTIONS body type but ignore it instead of rejecting
the entire OPTIONS response. Note that ICAP does not standardize OPTIONS
body types, and Squid does not recognize any body type.

ICAP servers are supposed to negotiate the use of OPTIONS bodies but
negotiation mechanism is not standardized and some do not negotiate at all.

14 years agoEnhance source maintenance scripts astyle detection
Amos Jeffries [Sat, 23 Oct 2010 13:35:36 +0000 (07:35 -0600)] 
Enhance source maintenance scripts astyle detection

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:34:46 +0000 (07:34 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Cleanup ETag comparison functions in preparation for If-Match support.

Replace etagIsEqual() with etagIsStrongEqual() function that does proper strong
ETag comparison instead of asserting on weak ETags.

Add etagIsWeakEqual() function for weak ETag comparison. Currently unused.

Both etagIs*Equal() functions call etagStringsMatch() helper to compare the tags.

No runtime behavior changes expected.

14 years agoMore unit-tests for HTTP request first in parser.
Amos Jeffries [Sat, 23 Oct 2010 13:33:56 +0000 (07:33 -0600)] 
More unit-tests for HTTP request first in parser.

Catches strange integer values for the version.

14 years agoBug 3051: integer display overflow
Amos Jeffries [Sat, 23 Oct 2010 13:33:05 +0000 (07:33 -0600)] 
Bug 3051: integer display overflow

This alters the cachemgr display formatting to use 64-bit integers
instead of 32-bit. Revealing overflows hiding behind display overflows.

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Sat, 23 Oct 2010 13:29:15 +0000 (07:29 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: Reply with an error if required validation fails.

RFC 2616 says that proxy MUST not use stale entries that have s-maxage,
proxy-revalidate, or must-revalidate cache-directive.

Add new fail_on_validation_err request flag to store result from
refreshCheck().  It is needed to avoid refreshLimits() recalculation in
clientReplyContext::handleIMSReply().

Split LOG_TCP_REFRESH_FAIL into LOG_TCP_REFRESH_FAIL_OLD (stale reply sent)
and LOG_TCP_REFRESH_FAIL_ERR (error forwarded). However, both are still logged
as TCP_REFRESH_FAIL for backward-compatibility with external scripts and such.
We may decide to start logging more detailed codes later.

Co-Advisor test cases:
    test_case/rfc2616/noSrv-hit-must-reval-s-maxage-resp
    test_case/rfc2616/noSrv-hit-must-reval-proxy-revalidate-resp
    test_case/rfc2616/noSrv-hit-must-reval-must-revalidate-resp

14 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 20 Oct 2010 14:04:31 +0000 (08:04 -0600)] 
SourceFormat Enforcement

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Wed, 20 Oct 2010 06:14:09 +0000 (00:14 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
HTTP Compliance: improve age calculation.

Account for response delay in age calculation as described in RFC 2616 section
13.2.3.

Co-Advisor test cases:
    test_case/rfc2616/ageCalc-none-7-none
    test_case/rfc2616/ageCalc-5400-4-5

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Amos Jeffries [Wed, 20 Oct 2010 06:09:27 +0000 (00:09 -0600)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Cleanup: Remove old_rep2 from clientReplyContext::handleIMSReply().

StoreEntry::getReply() returns pointer to HttpReply that belongs to MemObject.
It does not create a new object. Hence, outer old_rep, inner old old_rep, and
inner new old_rep2 in handleIMSReply() are equal.

No changes in Squid behavior are expected.