]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
14 years agoBug 3209: ssl-bumped requests forwarded unencrypted to the parent proxies/caches
Christos Tsantilas [Sat, 7 May 2011 05:48:50 +0000 (23:48 -0600)] 
Bug 3209: ssl-bumped requests forwarded unencrypted to the parent proxies/caches

This patch block all ssl-bumped requests which are not forwarded directly to
origin servers.

A new flag added to the requests_flags to mark http requests which are
ssl-bumped

14 years agoSupport OpenSSL 1.0.0 built without SSLv2
Amos Jeffries [Sat, 7 May 2011 05:45:36 +0000 (23:45 -0600)] 
Support OpenSSL 1.0.0 built without SSLv2

14 years agoFix a dirty last/unused item left after Vector<>::shift
Christos Tsantilas [Sat, 7 May 2011 05:39:55 +0000 (23:39 -0600)] 
Fix a dirty last/unused item left after Vector<>::shift

This is an old Vector<> bug that left a dirty last/unused item after
shift(). This causes problems if stored values have destructors.

14 years agoBug 3205: SSL-bump starts then hangs
Christos Tsantilas [Sat, 7 May 2011 03:16:27 +0000 (21:16 -0600)] 
Bug 3205: SSL-bump starts then hangs

The bug appeared after commit with revno:11364 which fixes Bug 3192.

In the case of SSL-bumped connections the ConnStateData::flags.readMore flag
must be reset (set to true) when we are switching to HTTPs,
because we have to read the new unencrypted HTTP request.
This patch reset this flag in ConnStateData::switchToHttps method.

14 years ago3.1.12.1 SQUID_3_1_12_1
Amos Jeffries [Tue, 19 Apr 2011 05:26:17 +0000 (23:26 -0600)] 
3.1.12.1

14 years agoFix: AnyP:: does not exist in 3.1
Amos Jeffries [Tue, 19 Apr 2011 00:33:25 +0000 (12:33 +1200)] 
Fix: AnyP:: does not exist in 3.1

14 years agoPrep for 3.1.12.1
Amos Jeffries [Mon, 18 Apr 2011 14:36:32 +0000 (02:36 +1200)] 
Prep for 3.1.12.1

14 years agoManager: send User-Agent header from cachemgr.cgi
Amos Jeffries [Mon, 18 Apr 2011 12:06:47 +0000 (06:06 -0600)] 
Manager: send User-Agent header from cachemgr.cgi

Uses hard-coded string "cachemgr.cgi/" instead of progname to avoid
complications from alternative names and when running under a browser.

May be elided in transit, however the VERSION sent here will help the
queried proxy respond appropriate to the CGI capabilities as we extend
the types and content of reports coming back from the future releases.

14 years agoBug 3183: Invalid URL accepted with url host part of only '@'.
Amos Jeffries [Mon, 18 Apr 2011 12:01:28 +0000 (06:01 -0600)] 
Bug 3183: Invalid URL accepted with url host part of only '@'.

3.0 results in an ICAP segfault handling these URLs.

Newer releases do not segfault as easily, but still accept the invalid
URL and there may be other unknown side-effects.

Makes the URL parser present ERR_INVALID_URL for this edge case.

14 years agoPortability: allow GnuRegex to use libcompat min()/max()
Amos Jeffries [Mon, 18 Apr 2011 12:00:32 +0000 (06:00 -0600)] 
Portability: allow GnuRegex to use libcompat min()/max()

14 years agoPortability: aio.h suffers from GCC-specific hacks on Linux 64-bit
Amos Jeffries [Mon, 18 Apr 2011 11:59:10 +0000 (05:59 -0600)] 
Portability: aio.h suffers from GCC-specific hacks on Linux 64-bit

64-bit file support on 32-bit systems uses GCC-specific #define to convert
the functions to 64-bit API but omits the struct aiocb passed as paremeter.

GCC seems not to mind, but non-GCC compilers barf on the invalid types.

14 years agoBug 3194: selinux may prevent ntlm_smb_lm_auth from using /tmp
David Hill [Mon, 18 Apr 2011 11:55:35 +0000 (05:55 -0600)] 
Bug 3194: selinux may prevent ntlm_smb_lm_auth from using /tmp

14 years agoBug 3185: 3.1.11 fails to compile on OpenBSD 4.8 and 4.9
Amos Jeffries [Mon, 18 Apr 2011 11:54:11 +0000 (05:54 -0600)] 
Bug 3185: 3.1.11 fails to compile on OpenBSD 4.8 and 4.9

14 years agoPortability Fix: getrlimit() / setrlimit() incompatible type 'struct rlimit'
Amos Jeffries [Mon, 18 Apr 2011 11:53:13 +0000 (05:53 -0600)] 
Portability Fix: getrlimit() / setrlimit() incompatible type 'struct rlimit'

On Linux (at least) with large file support but not full 64-bit environment.

The getrlimt / setrlimit are #define'd to getrlimite64 / setrlimit64
BUT, the struct rlimit internal fields are updated to 64-bit types individually
instead of a matching #define to struct rlimit64 as a whole.

One can only assume that GCC is casting to void* or some such major voodoo
which hides this type collision.

14 years agoPortability: glob.h requires GCC to compile on Linux.
Amos Jeffries [Mon, 18 Apr 2011 11:51:49 +0000 (05:51 -0600)] 
Portability: glob.h requires GCC to compile on Linux.

14 years agoICC: support 64-bit environments dirent definitions
Amos Jeffries [Mon, 18 Apr 2011 11:50:50 +0000 (05:50 -0600)] 
ICC: support 64-bit environments dirent definitions

struct dirent is not consistently defined for 32-bit and 64-bit enabled
environments. Provide a dirent_t type defined appropriate to the environment
for use instead.

14 years agoFix ModPoll signedness checks
Amos Jeffries [Mon, 18 Apr 2011 11:48:02 +0000 (05:48 -0600)] 
Fix ModPoll signedness checks

This npending test bug was preventing any poll() errors from being
noticed and displayed. Possibly leading to some of the weird hanging
reports we have been unable to replicate.

14 years agoPortability: Provide stdio wrappers for 64-bit in cstdio C++ builds
Francesco Chemolli [Mon, 18 Apr 2011 11:46:39 +0000 (05:46 -0600)] 
Portability: Provide stdio wrappers for 64-bit in cstdio C++ builds

stdio.h in that case provides fgetpos64, fopen64 if
__USE_FILE_OFFSET64 is defined. It then checks whether a gcc-specific
__REDIRECT macro is available (defined in sys/cdefs.h, depending on
__GNUC__ begin available).

If it is not available, it does a preprocessor #define.

Which <cstdio> undefines, with this comment:
 "// Get rid of those macros defined in <stdio.h> in lieu of real functions.".
When it does a namespace redirection ("namespace std { using ::fgetpos; }")
it goes blam, as fgetpos64 is available, while fgetpos is not.

To fix it, we need to supply global functions matching those
signatures (not macros).

e.g.

#include <stdio.h>
#if defined(__USE_FILE_OFFSET64) &&!defined(__REDIRECT) && defined(fgetpos)
#undef fgetpos
int fgetpos (FILE * f, fpos64_t *p) { return fgetpos64(f,p); }
#endif
#include <cstdio>

This every time we use <cstdio> (directly or indirectly).

This is triggered by us defining -D_FILE_OFFSET_BITS=64 when
--enable-large-files configure is used.

14 years agoDisplay ERROR in cache.log for invalid configured paths
Amos Jeffries [Mon, 18 Apr 2011 11:00:10 +0000 (05:00 -0600)] 
Display ERROR in cache.log for invalid configured paths

The validator that checks system paths for files and directories in the
configuration file sends error messages to stderr. It should send them to
cache.log for the admin to see easily.

Also, this makes the error display as FATAL ERROR when using -k parse to
indicate that it is fatal to the startup. Other management signals where
it is not necessarily fatal will only display as an ERROR.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 18 Apr 2011 05:33:13 +0000 (23:33 -0600)] 
SourceFormat Enforcement

14 years agoPortability: fix some compiler complaints
Amos Jeffries [Sun, 17 Apr 2011 13:25:44 +0000 (07:25 -0600)] 
Portability: fix some compiler complaints

14 years agoPort 3.2: Dynamic Ssl Certificate generation
Christos Tsantilas [Sun, 17 Apr 2011 06:02:10 +0000 (18:02 +1200)] 
Port 3.2: Dynamic Ssl Certificate generation

Feature details at: http://wiki.squid-cache.org/Features/DynamicSslCert

14 years agoTestBed: include config.h first when testing headers
Amos Jeffries [Sun, 17 Apr 2011 05:59:14 +0000 (17:59 +1200)] 
TestBed: include config.h first when testing headers

14 years agoICC support: code polish to reduce compile warnings
Amos Jeffries [Mon, 11 Apr 2011 12:00:03 +0000 (06:00 -0600)] 
ICC support: code polish to reduce compile warnings

size_t is guaranteed to be >= 0 and other signed/unsigned comparison issues

14 years ago3.1.12 SQUID_3_1_12
Amos Jeffries [Mon, 4 Apr 2011 01:22:47 +0000 (19:22 -0600)] 
3.1.12

14 years agoPrep for 3.1.12
Amos Jeffries [Sun, 3 Apr 2011 13:37:45 +0000 (01:37 +1200)] 
Prep for 3.1.12

14 years agoSimulate DIRECT tunnel to origin peers on CONNECT
Amos Jeffries [Sun, 3 Apr 2011 12:20:26 +0000 (06:20 -0600)] 
Simulate DIRECT tunnel to origin peers on CONNECT

Within reason. Check that at least the port matches. That gives us some
small measure of reason to believe its the same protocol inside or the
same app being CONNECTed to.

14 years agoOptimization (performance regression fix): Use bigger buffer for server reads.
Alex Rousskov [Sun, 3 Apr 2011 12:03:58 +0000 (06:03 -0600)] 
Optimization (performance regression fix): Use bigger buffer for server reads.

Change the server read buffer limits to 16KB minimum and 256KB maximum.
Used to be: 2KB and 2GB. And before r9766: 4KB and SQUID_TCP_SO_RCVBUF.

Trunk r9766 (Remove limit on HTTP headers read) made the default HTTP
server read buffer size 2KB instead of 4KB, visibly slowing down Squid
when kernel network buffers are full and can sustain larger Squid reads.
Doing up to twice as many network reads is expensive (and probably not
just because of the extra system call overheads).

We never grow that buffer size if the _parser_ does not need a bigger
buffer:  Even if the HTTP client is slower than the server, the buffer
stays small because it gives all the data to Store and Store eventually
just stalls reading via delayAwareRead() and read_ahead_gap. The
situation may be different with RESPMOD, but if the adaptation service
is fast, the buffer would still not grow.

This change does not reset the minimum buffer size to the old 4KB
default because memory is much cheaper compared to the days where that
default was set. 8KB may have worked too, but with 12KB median typical
response size a larger buffer may be a good idea for a busy Squid. More
performance work is needed to find the optimal value (which could depend
on the environment).

This change does not set the maximum buffer size to the current 2GB
limit because we have not tested how header and chunking parsers would
cope with malicious messages trying to run Squid out of RAM; and also
because no good parser should need that much lookahead space. Is 256KB
enough for all legitimate real-world response headers? We do not know.

It is tempting to use Config.tcpRcvBufsz or SQUID_TCP_SO_RCVBUF to find
the right minimum or maximum buffer size, but those parameters deal with
low-level TCP buffering aspects while this buffer deals with HTTP
parsing.

14 years agosignal.h is required before defining SA_* macros
Amos Jeffries [Sun, 3 Apr 2011 11:34:21 +0000 (05:34 -0600)] 
signal.h is required before defining SA_* macros

uncovered by LZZ precompiler.

14 years agoMake cache.log less noisy about usually benign events outside of admin control.
Alex Rousskov [Sun, 3 Apr 2011 11:33:34 +0000 (05:33 -0600)] 
Make cache.log less noisy about usually benign events outside of admin control.

Raised reporting level from 1 to 2 for 'statusIfComplete: Request not yet
fully sent' and 'clientProcessRequest: Invalid Request' messages after
observing important information drowning in their noise on busy proxies.

14 years agoReport eCAP service [re]start to cache.log by default.
Alex Rousskov [Sun, 3 Apr 2011 11:23:21 +0000 (05:23 -0600)] 
Report eCAP service [re]start to cache.log by default.

Reporting eCAP services may be important, especially since we have no other
interface to detect their presence and since folks will have to deal with
rogue services eventually.

Also raised eCAP service configuration notice level to 2.

14 years agoApply uri_whitespace before logging malformed requests
Christos Tsantilas [Sun, 3 Apr 2011 11:18:30 +0000 (05:18 -0600)] 
Apply uri_whitespace before logging malformed requests

This patch try to implement  the first option from those described at the
squid-dev thread with subject "Request URI logging for malformed requests":
  http://www.squid-cache.org/mail-archive/squid-dev/201101/0004.html

Currently the logged URI set using the setLogUri method (in client_side.cc and
client_side_reply.cc files). Also the setLogUri called at least two times for
every normal request. Moreover the setLogUri always check if the URI contains
characters which must escaped which in the case of normal requests it is not
needed because urlCanonicalClean always used before pass the URI to setLogUri.

This patch:
 - add a parameter to the setLogUri to say if the URI must cleaned and the
   uri_whitespace filtering must applied.
 - Remove the setLogUri call from the parseHttpRequest.
 - Call in all cases (HTTP request error or not) the setLogUri in
   clientProcessRequest
 - In the case the URL is not a valid HTTP request applies the uri_whitespace
   filtering.
 - In the case the URI is valid the uri_whitespace filtering is not required
   because it is already applied by the urpParse function.

This is a Measurement Factory project

14 years agoRFC 1738 encoder upgraded action flags
Amos Jeffries [Sun, 3 Apr 2011 11:16:42 +0000 (05:16 -0600)] 
RFC 1738 encoder upgraded action flags

This updates the encoder flags parameter to allow selection of individual
character sets of CTRLS, UNSAFE, and RESERVED.

Also, to permit selective omission of the % and space characters from the
UNSAFE set.

Also, an optimization is added to skip SAFE characters on a short-circuit.

14 years agoGive full Request-URI to eCAP adapters.
Alex Rousskov [Sun, 3 Apr 2011 11:05:39 +0000 (05:05 -0600)] 
Give full Request-URI to eCAP adapters.

Implement libecap::RequestLine::uri() to return full Request-URI instead
of URL path.

Niether full URL nor URL path is perfect because the actual request may
have full URI or a path, but Squid does not really keep that
information. This change makes our eCAP implementation consistent with
our ICAP implementation.

Eventually, eCAP may have an API that is guaranteed to return full
Request-URI and Squid may remember what kind of URI it got in the virgin
request, allowing for a more truthful implementation.

14 years agoMake DNS report failure on all packet construction errors
Amos Jeffries [Sun, 3 Apr 2011 11:04:25 +0000 (05:04 -0600)] 
Make DNS report failure on all packet construction errors

The attached patch alters the DNS lookup behaviour to abort with an error
in ALL cases where the rfc1035 library generates an error (negative result).

I'm not sure there is any noticable effect other than better code. The
error case *should* in old code be picked up on the initial packet
construction rather than the repeat packet. This may have been incorrect
given that the packet type is changing between A/AAAA.

14 years agoRegression fix: Replacing reply headers
Marco Beck [Fri, 1 Apr 2011 01:21:46 +0000 (19:21 -0600)] 
Regression fix: Replacing reply headers

Restores the functionality to replace reply headers as found in Squid 2.
header_replace worked for both request and reply headers back then.

The creation of request_header_access and reply_header_access altered
replace_headers to only work on requests. It should have received this
name split back then.

14 years agoCorrect debug statement about non-IPs on parse
Amos Jeffries [Fri, 1 Apr 2011 01:17:16 +0000 (19:17 -0600)] 
Correct debug statement about non-IPs on parse

14 years agoDisplay correct information on dstdomain clashes
Amos Jeffries [Fri, 1 Apr 2011 01:15:15 +0000 (19:15 -0600)] 
Display correct information on dstdomain clashes

Abort with an error when a wildcard entry is going to be
discarded because of a sub-domain entry.
Also whenever there is a mixup between a domain and its
sub-domain wildcard alternative.

Raise a non-fatal warning when a useless subdomain entry
is being discarded and its super-set wildcard kept.

Care is taken to present the singular subdomain for
possible removal and keep the wildcard.

14 years agoCleanup: Allow constant pointers to non-constant HttpMsgs
Alex Rousskov [Fri, 1 Apr 2011 01:14:21 +0000 (19:14 -0600)] 
Cleanup: Allow constant pointers to non-constant HttpMsgs

14 years agoLog details of the stored object when locates a Date:-less object in cache
Amos Jeffries [Wed, 30 Mar 2011 12:44:19 +0000 (06:44 -0600)] 
Log details of the stored object when locates a Date:-less object in cache

These details are difficult to find afterward and required to track down
the bug that caused them to be cached.

14 years agosquidclient: send cachemgr password via -w option
Amos Jeffries [Wed, 30 Mar 2011 12:38:06 +0000 (06:38 -0600)] 
squidclient: send cachemgr password via -w option

Preparation for internal cachemgr updates to use real proxy-auth.

The cachamgr password may now be sent in three ways:
  Deprecated:      mgr:info@password
  Current Option:  -w password mgr:info
  Preferred:       -u username -w password mgr:info

The old explicit @ syntax is now deprecated for visible use. The background
systems will still send it that way for cache_object: URLs. Use of this
overrides any -w option set. So it is still possible to login to a proxy
with one set of credentials and pass a separate password to the cachemgr.
The long-term plan is to drop @ completely in future.

The current option of just -w will convert the password to @ syntax in the
background but not add Proxy-Authentication headers. This may die in future.

The preferred alternative is to use -u and -w which triggers addition of real
Proxy-Authenticate headers. The username is not yet used by cachemgr but
may be required by the proxy ACL configuration.

14 years agosquidclient: use Cache-Control instead of Pragma
Amos Jeffries [Wed, 30 Mar 2011 12:36:28 +0000 (06:36 -0600)] 
squidclient: use Cache-Control instead of Pragma

14 years agosquidclient: send User-Agent header and -A option to alter it
Amos Jeffries [Wed, 30 Mar 2011 12:35:36 +0000 (06:35 -0600)] 
squidclient: send User-Agent header and -A option to alter it

14 years agoBug 2621: Provide request headers to RESPMOD when using cache_peer.
Alex Rousskov [Wed, 30 Mar 2011 12:02:11 +0000 (06:02 -0600)] 
Bug 2621: Provide request headers to RESPMOD when using cache_peer.

A short-term fix.

When FwdServer::_peer is set, HttpStateData constructor creates a new special
HttpRequest, overwriting the request pointer set in the parent
(ServerStateData) constructor to fwd->request.

To make matters worse, this special peer request has no headers at all (even
though flags and some cached/computed header values are copied). We initialize
it with the right URL, method, and protocol. We copy flags and a few other
random properties from the original request. We never copy the original
headers.

Furthermore, regardless of the peering, when we create the headers to send to
the next hop, those headers are temporary and not stored in any request
structure (see HttpStateData::buildRequestPrefix). The non-peering code
survives this because the request member points to fwd->request, which has the
headers. The peering code fails as illustrated by this bug.

I believe both cases are buggy because server-side adaptation and core code
should have access to the request headers we sent rather than the request
headers we received and adapted (or no headers at all). After all, it is the
sent headers that determine the next hop view of our Squid and adaptation
services should see a pair of _matching_ request and response headers.

I am pretty sure there are other bugs related to HttpStateData using a special
peer request structure instead of fwd->request. Please note that FwdState has
no idea that this substitution is going on.

This quick short-term fix uses the original request and its headers when
checking RESPMOD ACLs. This is what the patch in bug #2562 did for Squid v3.0.
For the reasons described above, this patch may be either insufficient or
wrong for the long-term fix.

14 years agoBug 3181: /dev/poll fails to build on Solaris with GCC 4.5.0
IIDA Yosiaki [Wed, 30 Mar 2011 11:55:07 +0000 (05:55 -0600)] 
Bug 3181: /dev/poll fails to build on Solaris with GCC 4.5.0

14 years agoBug 3173: Assertion bodyPipe!=NULL on SslBump CONNECT response writing failure
Alex Rousskov [Wed, 30 Mar 2011 11:53:48 +0000 (05:53 -0600)] 
Bug 3173: Assertion bodyPipe!=NULL on SslBump CONNECT response writing failure

Do not call ConnStateData::startClosing() when we fail to write our CONNECT
response while bumping a connection. startClosing() can only be used when we
handle response bodies. Just close the connection, in hope that the connection
close handler kicks in and cleans up.

14 years agoBug 2330: AuthUser objects are never unlocked
Frank Schmirler [Mon, 28 Mar 2011 11:31:28 +0000 (05:31 -0600)] 
Bug 2330: AuthUser objects are never unlocked

This is a partial port of the Buug 2305 auth fixes.
These changes involve combining the auth operation state links to
credentials data such that the shared code can lock/unlock them properly.

14 years agoBug 3175: IPv6 PTR lookup crashes on raw-IP URLs when IPv6 disabled
Amos Jeffries [Tue, 22 Mar 2011 12:06:53 +0000 (06:06 -0600)] 
Bug 3175: IPv6 PTR lookup crashes on raw-IP URLs when IPv6 disabled

14 years agoBug 2976: invalid URL on intercepted requests during reconfigure
Amos Jeffries [Tue, 22 Mar 2011 12:04:26 +0000 (06:04 -0600)] 
Bug 2976: invalid URL on intercepted requests during reconfigure

Listening ports abuse the cbdata type as a pseudo refcount. This breaks
during reconfigure when the config is erased and the active requests
handles all become invalid pointers.

Interception only works on HTTP protocol. We can hard-code the scheme
and avoid this problem until a complete fix is written.

14 years agoBug 3177: assertion failed: comm.cc:1583: "fd >= 0"
Amos Jeffries [Fri, 18 Mar 2011 12:44:47 +0000 (01:44 +1300)] 
Bug 3177: assertion failed: comm.cc:1583: "fd >= 0"

This is a fix for the crash. There is a deeper TCP connection problem
which leads to it. see bug report for details.

14 years agoBug 3155: Werror is hard-coded in libTrie build
Amos Jeffries [Mon, 28 Feb 2011 10:41:20 +0000 (03:41 -0700)] 
Bug 3155: Werror is hard-coded in libTrie build

TODO: we should also adapt -Wall and suport non-GCC compiler flags

14 years agoBug 2720: comment in same line as cache/mem_replacement_policy causes error
Amos Jeffries [Mon, 28 Feb 2011 10:36:18 +0000 (03:36 -0700)] 
Bug 2720: comment in same line as cache/mem_replacement_policy causes error

14 years agoBug 3164: Total memory info display 32-bit overflows
Amos Jeffries [Sun, 27 Feb 2011 09:44:25 +0000 (22:44 +1300)] 
Bug 3164: Total memory info display 32-bit overflows

Use double instead of long. This removes any Squid-caused overflow wraps.
Overflows may still appear since the underlying library is 32-bit.

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