]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
14 years agoLanguage: en updates
Amos [Wed, 4 May 2011 00:05:11 +0000 (12:05 +1200)] 
Language: en updates

14 years agoLanguage: en updates
Amos [Tue, 3 May 2011 06:01:46 +0000 (18:01 +1200)] 
Language: en updates

14 years agoDocs: Polish url_rewrite_program description
Colin Coe [Tue, 3 May 2011 03:01:59 +0000 (15:01 +1200)] 
Docs: Polish url_rewrite_program description

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 3 May 2011 00:12:39 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoDrop testAuth unit-tests
Amos Jeffries [Mon, 2 May 2011 13:04:21 +0000 (01:04 +1200)] 
Drop testAuth unit-tests

Preparing to move the tests into src/auth.

These old tests construction style also require quite a lot of dependencies
which include several loops causing problems in modern strict linkers.
Opted to remove now and stabilize trunk without it before re-adding simpler
auth unit tests.

14 years agotypo in ntlm_fake_auth
Amos Jeffries [Mon, 2 May 2011 02:33:27 +0000 (20:33 -0600)] 
typo in ntlm_fake_auth

14 years agoCleanup: base64 coder de-duplication and upgrade
Amos Jeffries [Mon, 2 May 2011 01:14:30 +0000 (19:14 -0600)] 
Cleanup: base64 coder de-duplication and upgrade

Markus Moeller has re-implemented several of the coder functions for use
by Kerberos helpers.

This patch seeks to de-duplicate them and combine the resulting code
back into the libmiscencoding.la "base64.h" implementation.

Changes include:

  * old function API renamed to old_*() and existing code update to use
the names. Some code has been updated to use the new API.

  * new estimator base64_encode_len()/base64_decode_len() functions added
to provide details of much much buffer space the output will require.

  * new API encoder and decoder functions added which accept caller
provided buffers and encode/decode an arbitrary string into them.

  * also fixes a bug where if the input text or output buffer was too
short the coder functions would crop a few bytes off the end of the result.
Noticable in Kerberos where token lengths are not fixed length.

Some optimizations have been added by myself over and above Markus changes:

  * optimized to short-circuit on several more variations of empty input
and nil result buffer.

  * sub-loop optimizations added to reduce the number of if() calls made
by the new code.

  * split encoder into terminated (C-str) and non-terminated variants.

Also documented both old and new APIs functions.

14 years agoAdd external_acl_type %EXT_LOG and %EXT_TAG format options.
James Bowe [Sun, 1 May 2011 12:10:37 +0000 (00:10 +1200)] 
Add external_acl_type %EXT_LOG and %EXT_TAG format options.

%EXT_LOG and %EXT_TAG are filled with the log= and tag= fields
returned by previous external ACLs.

-for a string that never changes after it is set, tag= is suitable.
-for a string that may need updating or overwriting by a later
external_acl, log= is suitable.

Under both circumstances it is conceivable that later external_acls
may need access to the tag= or log= values after they have been set
(e.g. for external_acl debugging, merging log messages, etc).

14 years agoBug 3203: pkg-config replacement broken on Windows
Amos Jeffries [Sun, 1 May 2011 03:03:37 +0000 (15:03 +1200)] 
Bug 3203: pkg-config replacement broken on Windows

14 years agoBug 3205: SSL-bump is broken in trunk
Christos Tsantilas [Thu, 28 Apr 2011 19:32:43 +0000 (22:32 +0300)] 
Bug 3205: SSL-bump is broken in trunk

The bug appeared after commit with revno:11364 which fixes the 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 agoUpdate release notes on deny_info changes
Amos Jeffries [Thu, 28 Apr 2011 17:04:06 +0000 (05:04 +1200)] 
Update release notes on deny_info changes

14 years agoPerformance: short-circuit reply_body_max_size ACL tests
Amos Jeffries [Wed, 27 Apr 2011 23:48:03 +0000 (11:48 +1200)] 
Performance: short-circuit reply_body_max_size ACL tests

In the common default case there are no reply body limits configured.
There is no need to construct ACL checklists for testing. This saves
one allocation and several locking/unlocking cycles per request.

14 years agoBug fix: A dirty last/unused item left after Vector<>::shift
Christos Tsantilas [Tue, 26 Apr 2011 10:15:04 +0000 (13:15 +0300)] 
Bug 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 agoPortability fix: explicitly state dependency on libtool 2.2+ and enforce it
Francesco Chemolli [Sat, 23 Apr 2011 07:11:07 +0000 (09:11 +0200)] 
Portability fix: explicitly state dependency on libtool 2.2+ and enforce it

14 years agoPortability fix: always install libltdl and change autoconf initialization
Francesco Chemolli [Sat, 23 Apr 2011 05:32:01 +0000 (07:32 +0200)] 
Portability fix: always install libltdl and change autoconf initialization

14 years agoDocs: clarify bits/bytes on delay pools
Amos Jeffries [Wed, 20 Apr 2011 07:11:27 +0000 (01:11 -0600)] 
Docs: clarify bits/bytes on delay pools

14 years agoAdd errpages option %b for proxy listening port
Amos Jeffries [Wed, 20 Apr 2011 06:07:08 +0000 (18:07 +1200)] 
Add errpages option %b for proxy listening port

Use getMyPort() to insert the forward-proxy listening port into error
pages and deny_info redirect URLs. This fixes the current port
hard-coding assumption in ERR_AGENT_CONFIGURE.

The %b option is added for this purpose as a temporary measure until the
codes are merged with the more flexible log formatting set.

This currently depends on squid.conf having a particular http_port
ordering with the forward-proxy port listed first.

14 years agoSourceLayout: Add enum Direction for AuthUserRequests state logics
Amos Jeffries [Wed, 20 Apr 2011 05:08:16 +0000 (17:08 +1200)] 
SourceLayout: Add enum Direction for AuthUserRequests state logics

The state of credentials lookup and handling is recorded by
authenticateDirection / AuthUserRequest::direction() and its per-scheme
helper methods AuthUserRequest::module_direction().

This formalizes and coordinates the state being returned by using a
shared enum.

The states can generally be considerd as:
 - LOOKUP with a helper still needs to validate the credentials
 - CHALLENGE if the helepr needs more info from the client
 - VALID if everything is fine and the credentials are known Good/Bad
 - ERROR if there is any problem with the state or credentials

TODO:
 This combination has highlighted a few strange things in the NTLM and
Negotiate states. Where known but Failed credentials are marked as ERROR.
This needs closer investigation why it is not a CHALLENGE in all auth
schemes.

 Also there is a little obfuscation of the cases around the generalized
fixHeader() calls. This will be handled in a followup patch.

14 years agonegotiate_wrapper_auth: fix strict compiler warnings
Amos Jeffries [Tue, 19 Apr 2011 13:20:31 +0000 (01:20 +1200)] 
negotiate_wrapper_auth: fix strict compiler warnings

14 years agoTypos in 3.1 release notes
Amos Jeffries [Mon, 18 Apr 2011 14:42:25 +0000 (02:42 +1200)] 
Typos in 3.1 release notes

14 years agoPrep for 3.1.12.1 and 3.2.0.7
Amos Jeffries [Mon, 18 Apr 2011 12:27:45 +0000 (06:27 -0600)] 
Prep for 3.1.12.1 and 3.2.0.7

14 years agoBundle pkg.m4 from pkg-config 0.25
Scott James Remnant [Mon, 18 Apr 2011 10:22:30 +0000 (22:22 +1200)] 
Bundle pkg.m4 from pkg-config 0.25

These macros are required for ./configure to run on an OS such as MingW.

The macro to detect pkg-config being present is usualy only bundled with
pkg-config. When there is no pkg-config installed ./configure will fail.
This allows our configure to detect the absence and mark some components
as unavailable or unusable.

14 years agoFixes NTLM and Negotiate auth assertion "RefCountCount() == 2"
Amos Jeffries [Sun, 17 Apr 2011 03:35:52 +0000 (21:35 -0600)] 
Fixes NTLM and Negotiate auth assertion "RefCountCount() == 2"

It turns out the replay cache and invalid RefCount cases this was added to
protect againt are not present anyway. After some minor cleanup to remove
double-calls in Negotiate things appear to run nicely.

NOTE:
 There is still a risk that these problem cases may in future occur, but
 meanwhile we need NTLM and Negotiate to be usable and efficient.
 The bugs resulting from those can be dealt with if/when they do occur.

14 years agonegotiate_wrapper_auth: various portability fixes
Amos Jeffries [Sat, 16 Apr 2011 14:43:18 +0000 (02:43 +1200)] 
negotiate_wrapper_auth: various portability fixes

14 years agonegotiate_wrapper_auth: version 1.0.1
Markus Moeller [Fri, 15 Apr 2011 11:51:15 +0000 (05:51 -0600)] 
negotiate_wrapper_auth: version 1.0.1

A helper to perform Negotaite authentication in both its Negotiate/NTLM
and Negotiate/Kerberos forms.
Makes use of additional Squid helpers after unwrapping the header token.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 15 Apr 2011 00:12:31 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoSourceLayout: namesapce for Auth::User children
Amos Jeffries [Thu, 14 Apr 2011 02:40:59 +0000 (20:40 -0600)] 
SourceLayout: namesapce for Auth::User children

Also, shuffle the resulting classes into their own compilation units.

No Logic changes.
Have omitted shuffling or altering two Auth::Basic::User methods handling
the validation short-circuit since these shodul not be part of that class.
Followup patch will move them appropriately.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 13 Apr 2011 00:12:37 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoManager: send User-Agent header from cachemgr.cgi
Amos Jeffries [Tue, 12 Apr 2011 11:33:32 +0000 (23:33 +1200)] 
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 teh 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 agoSourceLayout: add missing CredentialState.h
Amos Jeffries [Tue, 12 Apr 2011 06:01:32 +0000 (00:01 -0600)] 
SourceLayout: add missing CredentialState.h

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 12 Apr 2011 00:12:32 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoSourceLayout: namespace for Auth::User
Amos Jeffries [Mon, 11 Apr 2011 14:08:54 +0000 (08:08 -0600)] 
SourceLayout: namespace for Auth::User

No logic changes.

14 years agoImport SN.png correctly as binary.
Amos Jeffries [Mon, 11 Apr 2011 06:09:21 +0000 (18:09 +1200)] 
Import SN.png correctly as binary.

14 years agoRe-fix icons/ FHS compliance
Amos Jeffries [Mon, 11 Apr 2011 06:05:36 +0000 (18:05 +1200)] 
Re-fix icons/ FHS compliance

It seems I was working out of an outdated copy of the FHS.
Current standards describe /var/www as deprecated.

Reverting the icons location back to where it started.

14 years agoSourceLayout: Shuffle InitAuthSchemes() to Auth::Init()
Amos Jeffries [Mon, 11 Apr 2011 03:25:32 +0000 (21:25 -0600)] 
SourceLayout: Shuffle InitAuthSchemes() to Auth::Init()

No logic changes.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 11 Apr 2011 00:12:56 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoBug 3183: Invalid URL accepted with url host part of only '@'.
Amos Jeffries [Sun, 10 Apr 2011 02:00:38 +0000 (14:00 +1200)] 
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 agoSourceLayout: namespace for Auth::Config children
Amos Jeffries [Sun, 10 Apr 2011 01:31:59 +0000 (19:31 -0600)] 
SourceLayout: namespace for Auth::Config children

No Logic changes.

Also, no code shuffling which should normally have been done with namespace.
Config children are currently too intwined with UserRequest children and
helper management. Logic changes are required before that can be done.

14 years agoPortability: allow GnuRegex to use libcompat min()/max()
Amos Jeffries [Sat, 9 Apr 2011 13:31:29 +0000 (01:31 +1200)] 
Portability: allow GnuRegex to use libcompat min()/max()

14 years agoPortability: aio.h suffers from GCC-specific hacks on Linux 64-bit
Amos Jeffries [Sat, 9 Apr 2011 06:36:51 +0000 (18:36 +1200)] 
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 agoSourceLayout: namespace for Auth::Config
Amos Jeffries [Sat, 9 Apr 2011 04:25:23 +0000 (22:25 -0600)] 
SourceLayout: namespace for Auth::Config

Also renames symbol Auth::authConfig to Auth::ConfigVector to clarify
that it is a vector<> of Auth::Config objects or children.

No logic changes.

14 years agoBug 3192: comm.cc:216: "fd_table[fd].halfClosedReader != NULL"
Alex Rousskov [Sat, 9 Apr 2011 04:01:00 +0000 (22:01 -0600)] 
Bug 3192: comm.cc:216: "fd_table[fd].halfClosedReader != NULL"
Polished request reading code to fix CONNECT double-read assertion.

ConnStateData::flags.readMoreRequests, do_next_read variables, and
ClientSocketContext::mayUseConnection() methods were used (or unused!)
incorrectly or inconsistently.

This change removes all do_next_read variables to simplify the state. Instead,
the renamed ConnStateData::flags.readMore indicates whether client_side.cc
should call comm_read. The mayUseConnection() methods are now used to indicate
whether the next client-sent byte (buffered or read) should be reserved for
the current request rather than being interpreted as the beginning of the next
request.

Usually,
                      flags.readMore  mayUseConnection
      basic requests:     true             false
requests with bodies:     true             true
  malformed requests:     false            false
             tunnels:     false            true

14 years agoPortability: a bit more dirent_t in squidpurge tool
Amos Jeffries [Sat, 9 Apr 2011 03:23:50 +0000 (15:23 +1200)] 
Portability: a bit more dirent_t in squidpurge tool

14 years agoBug 3194: selinux may prevent ntlm_smb_lm_auth from using /tmp
David Hill [Sat, 9 Apr 2011 02:37:59 +0000 (14:37 +1200)] 
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 [Fri, 8 Apr 2011 13:15:03 +0000 (01:15 +1200)] 
Bug 3185: 3.1.11 fails to compile on OpenBSD 4.8 and 4.9

14 years agoPortability: and dirent_t also only matters for non-GCC.
Amos Jeffries [Fri, 8 Apr 2011 12:31:09 +0000 (00:31 +1200)] 
Portability: and dirent_t also only matters for non-GCC.

14 years agoPortability: dirent_t cannot be a typedef
Amos Jeffries [Fri, 8 Apr 2011 02:37:19 +0000 (14:37 +1200)] 
Portability: dirent_t cannot be a typedef

14 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 8 Apr 2011 00:12:34 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoPortability Fix: getrlimit() / setrlimit() incompatible type 'struct rlimit'
Amos Jeffries [Thu, 7 Apr 2011 14:52:13 +0000 (02:52 +1200)] 
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 [Thu, 7 Apr 2011 13:41:25 +0000 (01:41 +1200)] 
Portability: glob.h requires GCC to compile on Linux.

14 years agoEnable MemBlob to use the services of MemPools.
Francesco Chemolli [Thu, 7 Apr 2011 13:26:54 +0000 (15:26 +0200)] 
Enable MemBlob to use the services of MemPools.

Ensure that MemBlobs use MemPools manage memory areas, and remove
duplication of code with MemPools.

14 years agoICC: size_t is guaranteed to be >=0
Amos Jeffries [Thu, 7 Apr 2011 12:42:02 +0000 (00:42 +1200)] 
ICC: size_t is guaranteed to be >=0

14 years agoICC: support 64-bit environments dirent definitions
Amos Jeffries [Thu, 7 Apr 2011 11:58:46 +0000 (23:58 +1200)] 
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 [Thu, 7 Apr 2011 09:23:06 +0000 (21:23 +1200)] 
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 agoSourceFormat Enforcement
Automatic source maintenance [Thu, 7 Apr 2011 00:18:17 +0000 (18:18 -0600)] 
SourceFormat Enforcement

14 years agoExtend the number and size of String MemPools
Francesco Chemolli [Wed, 6 Apr 2011 22:45:40 +0000 (00:45 +0200)] 
Extend the number and size of String MemPools

Define and enable 512-bytes, 1kb, 4kb and 16kb mempooled strings
to cover expected upcoming uses

14 years agoFixed chunked request forwarding in ICAP REQMOD presence.
Alex Rousskov [Wed, 6 Apr 2011 16:25:36 +0000 (10:25 -0600)] 
Fixed chunked request forwarding in ICAP REQMOD presence.

ICAP prohibits forwarding of hop-by-hop headers in HTTP headers. If the virgin
request has a "Transfer-Encoding: chunked" header, the ICAP server will not
receive it. Thus, when the ICAP server responds with a 200 OK and what it
thinks is a copy of the HTTP request, the adapted request will be missing the
Transfer-Encoding header.

One the server side, Squid used to test whether the request had a
Transfer-Encoding header to determine whether request chunking is needed when
talking to the next HTTP hop. That test would fail in ICAP REQMOD presence.

This change implements a more direct/robust check: if we do not know the
request content length, we chunk the request.

We also no longer forward the Content-Length header if we are chunking. It
should not really be there in most cases, but an explicit check is safer and
may also prevent request smuggling attacks via Connection: Content-Length
tricks.

14 years agoPortability: Provide stdio wrappers for 64-bit in cstdio C++ builds
Francesco Chemolli [Wed, 6 Apr 2011 13:58:14 +0000 (01:58 +1200)] 
Portability: Provide stdio wrappers for 64-bit in cstdio C++ builds

stdio.h in that case on 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 agoEnable string mempools to work correctly during initialization phase
Francesco Chemolli [Wed, 6 Apr 2011 10:40:10 +0000 (12:40 +0200)] 
Enable string mempools to work correctly during initialization phase

Makes string mempools work before Mem::Init() was called, as may happen
during global variable initialization or early main.cc processing. If
needed, strings allocated before the Mem::Init() call are given an extra
buffer space to make sure the allocated buffer size will not match any
string pool size during deallocation.
Shortcomings: We now waste RAM on buffer increase for early allocated
strings unless they are already bigger than the maximum supported string
pool size. Statistics for early allocations are broken. Non-string
mempools still do not support early allocations.

14 years agoFixed %dt logging in the presence of REQMOD.
Alex Rousskov [Tue, 5 Apr 2011 21:39:53 +0000 (15:39 -0600)] 
Fixed %dt logging in the presence of REQMOD.

We use LogEntry::request to save a virgin request for future logging. However,
when that request is adapted and replaced, the adapted request has all the
stats while the saved virgin request lacks them. We have already copied error
details from the adapted to logged/virgin request. Now we copy the DNS wait
time (%dt) as well.

TODO: Move statistics to a stand-alone history object that adapted and
virgin requests can share. Longer term, we should separate HttpRequest
from Master Transaction so that we can store virgin request details without
implicitly storing not-yet-collected master transaction stats.

14 years agoPolished adaptation_send_client_ip and adaptation_uses_indirect_client docs.
Alex Rousskov [Tue, 5 Apr 2011 20:57:57 +0000 (14:57 -0600)] 
Polished adaptation_send_client_ip and adaptation_uses_indirect_client docs.

14 years agoDisplay ERROR in cache.log for invalid configured paths
Amos Jeffries [Tue, 5 Apr 2011 13:04:11 +0000 (01:04 +1200)] 
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 agoDocs: clarify delay_parameters
Amos Jeffries [Mon, 4 Apr 2011 22:57:34 +0000 (10:57 +1200)] 
Docs: clarify delay_parameters

14 years agoPropagate pre-processor directives from enum definition to strings definition
Amos Jeffries [Mon, 4 Apr 2011 12:57:49 +0000 (00:57 +1200)] 
Propagate pre-processor directives from enum definition to strings definition

This allows enum to contain conditional entries and build without them.

14 years agoTypos in 3.1 release notes
Amos Jeffries [Sun, 3 Apr 2011 13:38:36 +0000 (07:38 -0600)] 
Typos in 3.1 release notes

14 years agoPrep for 3.1.12 and 3.2.0.6
Amos Jeffries [Sun, 3 Apr 2011 13:10:56 +0000 (07:10 -0600)] 
Prep for 3.1.12 and 3.2.0.6

14 years agoSimulate DIRECT tunnel to origin peers on CONNECT
Amos Jeffries [Sun, 3 Apr 2011 12:17:09 +0000 (06:17 -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 [Fri, 1 Apr 2011 14:47:51 +0000 (08:47 -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 agoLog all transactions including those with uncertain status or no sent response.
Alex Rousskov [Fri, 1 Apr 2011 14:39:24 +0000 (08:39 -0600)] 
Log all transactions including those with uncertain status or no sent response.

Excluding those transactions from access log hides valuable information.

For example, it hides certain aborted client transactions which sometimes
indicate Squid bugs or configuration problems that the administrator can fix.
It also leads to wrong statistics reporting if the reporting tools are based
on access logs information.

The change just removes the logging guard and adds debugging. The logging
code itself is unchanged except for indenting.

14 years agoRelease Notes: add missing text about changes to range_offset_limit
Amos Jeffries [Fri, 1 Apr 2011 02:27:30 +0000 (15:27 +1300)] 
Release Notes: add missing text about changes to range_offset_limit

14 years agoBug 3007 (extra): Set 500 status on peer proxy connection failure
Amos Jeffries [Fri, 1 Apr 2011 02:04:29 +0000 (15:04 +1300)] 
Bug 3007 (extra): Set 500 status on peer proxy connection failure

rev11299 avoided 000 status, but ignores the error cases and always sends
200 success.

TODO:
Proper handling of the error cases to allow peer failovers is now possible
but not included in the scope of this patch.

14 years agoDefault constructor for HttpParser
Amos Jeffries [Thu, 31 Mar 2011 22:47:06 +0000 (16:47 -0600)] 
Default constructor for HttpParser

rev11314 added an no-op default constructor. But that could allow creation
with broken state.

Add a clear() function to perform the default constructor initialization.
That can also be shared by the other init code.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 31 Mar 2011 00:22:13 +0000 (18:22 -0600)] 
SourceFormat Enforcement

14 years agoOptimization: Do not create adaptation history to check whether it is empty.
Alex Rousskov [Wed, 30 Mar 2011 23:09:07 +0000 (17:09 -0600)] 
Optimization: Do not create adaptation history to check whether it is empty.

14 years agoDo not send signals from the master process to parent on shutdown.
Dmitry Kurochkin [Wed, 30 Mar 2011 20:50:00 +0000 (14:50 -0600)] 
Do not send signals from the master process to parent on shutdown.

Trunk r11330 introduced a bug: When running in non-daemon mode, Squid
sends SIGUSR1 signal to the parent process on shutdown.  This results in
shell (at least zsh) exit when Squid is interrupted with C-c. The patch
adds a check to prevent the master process from killing it's parent on
shutdown.

Same check added for the kill-parent hack.

14 years agoIf a worker process crashes during shutdown, dump core and prevent restarts.
Dmitry Kurochkin [Wed, 30 Mar 2011 19:39:14 +0000 (13:39 -0600)] 
If a worker process crashes during shutdown, dump core and prevent restarts.

Before the change, if a worker process crashes during shutdown, death()
handler would exit with code 1, and master process would restart the
worker. Now workers send SIGUSR1 to master when shutting down. When
master process gets the SIGUSR1 signal, it stops restarting workers.

SIGUSR1 is already used for log rotation, but it is fine to use SIGUSR1
for master process shutdown notifications because master is never
responsible for both log rotation and kid restarts.

Terminate with abort(3) instead of exit(3) to leave a core dump if Squid
worker crashes during shutdown.

Also the patch fixes potential infinite loop in master process. Master
used to finish only when all kids exited with success, or all kids are
hopeless, or all kids were killed by a signal, but when some kids are
hopeless and others were killed, the master process would not exit.
After the change, master exits when there are no running kids and no
kids should be restarted.

Add syslog notice if kid becomes hopeless.

14 years agoBetter reporting of REQMOD failures during body processing.
Alex Rousskov [Wed, 30 Mar 2011 18:14:08 +0000 (12:14 -0600)] 
Better reporting of REQMOD failures during body processing.

When REQMOD body processing fails, the server-side needs to abort the
in-progress transaction. Use HTTP 500 (Internal Server Error) instead of 502
(Bad Gateway) status code and a new custom error detail for this case.

There is no perfect status code for ICAP errors because some view ICAP
processing as an integral part of the proxy (closer to the internal
proxy code) and some treat it as an external entity (closer to an
"upstream" web server).

Nevertheless, 502 (Bad Gateway) feels like a worse fit because from web
user and traffic flow point of views ICAP is less of a "gateway" or
"upstream" server than it is an "internally" used auxiliary service.
When both status codes were used, we have received reasonable complaints
about 502 responses but not (IIRC) about 500 responses.

Using custom error detail is better than errno in this context because
errno is often not set for ICAP errors and because by the time we
generate an error, the errno value is likely to be from a different
system call error anyway.

14 years agoInstead of exiting, disable optional eCAP services that fail initialization.
Alex Rousskov [Wed, 30 Mar 2011 18:07:38 +0000 (12:07 -0600)] 
Instead of exiting, disable optional eCAP services that fail initialization.

Report all service initialization failures but mark optional services
down instead of killing Squid by propagating the failure to the Squid
core.  An initialization failure of an optional (bypass=1) service
should not lead to Squid quitting because, according to squid.conf, such
a service may be replaced by other services (using adaptation sets) or
simply ignored.

Initialization failures of essential services still lead to fatal
errors, but they are now reported better.

Ecap services should indicate failures by throwing an exception. Squid
reports exception details using std::exception::what() method if
possible.

14 years agoSupport dynamic adaptation plans that cover multiple vectoring points.
Alex Rousskov [Wed, 30 Mar 2011 17:43:55 +0000 (11:43 -0600)] 
Support dynamic adaptation plans that cover multiple vectoring points.

The dynamic adaptation plan is specified using X-Next-Services ICAP
header or eCAP meta-info, as usual. A REQMOD adaptation service may
construct an adaptation plan that starts with REQMOD and ends with
RESPMOD. Multiple adaptations may be planned at each point.

The natural transaction handling order must be preserved: the plan
cannot go from RESPMOD back to REQMOD.

Adaptation::History object is used to keep future plan steps when
crossing vectoring points.

14 years agoUse prefix increment in place of postfix where appropriate in mem.cc
Francesco Chemolli [Wed, 30 Mar 2011 16:50:18 +0000 (18:50 +0200)] 
Use prefix increment in place of postfix where appropriate in mem.cc

14 years agoInclude iosfwd instead of ostream in Mem.h
Francesco Chemolli [Wed, 30 Mar 2011 16:44:16 +0000 (18:44 +0200)] 
Include iosfwd instead of ostream in Mem.h

14 years agoPort 2.7: logformat tag for logging the outgoing IP address (tcp_outgoing_address)
Amos Jeffries [Wed, 30 Mar 2011 04:29:35 +0000 (22:29 -0600)] 
Port 2.7: logformat tag for logging the outgoing IP address (tcp_outgoing_address)

This adds the log format to log the local IP address used on outgoing
connections to peers and servers. Squid-2.7 called this %oa.

However it is a perfectly matching part of the existing set of %la and
%lp (local inbound) and %<lp (local outbound port).

As such, the %oa is accepted as input for backward compatibility, but the
Squid-3 version is: %<la

This is based only very loosely on the Squid-2 %oa work by Andrew Atangulov

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 29 Mar 2011 00:14:45 +0000 (18:14 -0600)] 
SourceFormat Enforcement

14 years agoext_edirectory_userip_acl: Update to version 2.1
Chad Naugle [Mon, 28 Mar 2011 22:52:09 +0000 (16:52 -0600)] 
ext_edirectory_userip_acl: Update to version 2.1

14 years agoSourceLayout: namespace for Auth::Scheme top layer
Amos Jeffries [Mon, 28 Mar 2011 13:47:37 +0000 (07:47 -0600)] 
SourceLayout: namespace for Auth::Scheme top layer

Also, rename Scheme::done() to shutdownCleanup() - naming it for what it
actually does rather than when to call it.

Also includes the typo fix for revno 11319 basic auth child.

14 years agoBug 3170: "Unsupported or unconfigured/inactive proxy-auth scheme" on shutdown
Amos Jeffries [Mon, 28 Mar 2011 11:24:45 +0000 (05:24 -0600)] 
Bug 3170: "Unsupported or unconfigured/inactive proxy-auth scheme" on shutdown

14 years agoSourceLayout: (Bug 3170) namespace for Auth::Scheme and children
Amos Jeffries [Mon, 28 Mar 2011 10:51:53 +0000 (04:51 -0600)] 
SourceLayout: (Bug 3170) namespace for Auth::Scheme and children

Also,
 * fix digest shutdown process so AuthDigestConfig does the config cleanup
   and Auth::Digest::Scheme does the scheme termination
 * fix all schemes shutdown to silence scheme messages (partial bug 3170)

14 years agoCleanup: global/static function or methods should start from capital letter
Christos Tsantilas [Mon, 28 Mar 2011 08:01:07 +0000 (11:01 +0300)] 
Cleanup: global/static function or methods should start from capital letter

This patch renames the getErrorName and getErrorDescr to GetErrorName and
GetErrorDescr

14 years ago%D details for documented OpenSSL errors
Christos Tsantilas [Mon, 28 Mar 2011 07:52:08 +0000 (10:52 +0300)] 
%D details for documented OpenSSL errors

This simple patch provide %D details for all errors documented at
http://www.openssl.org/docs/apps/verify.html

Also this patch add a std::map structure to optimize the ssl error description
retrieval.

This is a Measurement Factory project

14 years agoSourceLayout: build auth sub-libraries in abstraction
Amos Jeffries [Mon, 28 Mar 2011 04:02:03 +0000 (22:02 -0600)] 
SourceLayout: build auth sub-libraries in abstraction

This changes the building process for auth sub-libraries:
 libbasic.la, libdigest.la, libnegotiate.la, libntlm.la
making them build from their own Makefiles.

That allows each sub-dir to be automatically included (or not) to the main
auth/libauth.la library.

TODO: (no necessarily in this order)
 * split out the classes into their own compile units (files)
 * add namespace Auth and per-protocol child areas
 * de-duplicate the repetitive code back into the parent classes

14 years agoCleanup: rename auth Config::authenticate to Config::authenticateProgram
Amos Jeffries [Sun, 27 Mar 2011 05:59:28 +0000 (23:59 -0600)] 
Cleanup: rename auth Config::authenticate to Config::authenticateProgram

Making it a bit clearer what this member actually is.

14 years agoCleanup: make clientParseRequest() a member of ConnStateData
Amos Jeffries [Sat, 26 Mar 2011 02:03:49 +0000 (15:03 +1300)] 
Cleanup: make clientParseRequest() a member of ConnStateData

This allows the HttpParser to also become a member field and persistent
across all requests on the connection instead of newely allocated on
the stack for every read cycle.
That in turn allows the parser to retain state for efficient 'trickle'
parsing across multiple read cycles.

For now the old behaviour of reset on every read is retained in order to
prevent this shuffling from causing behaviour changes. That negates most
of the actual performance gains (for now).

14 years agoFix stdio: log module segfaults on rotate
Amos Jeffries [Fri, 25 Mar 2011 15:17:08 +0000 (04:17 +1300)] 
Fix stdio: log module segfaults on rotate

The stdio module was still assuming old format for the parameter.

 * update the parser to detect old format and upgrade-warn.
 * update the stdio module to ignore the stdio: prefix on its parameter

14 years agoRegression fix: Replacing reply headers
Marco Beck [Fri, 25 Mar 2011 11:47:08 +0000 (00:47 +1300)] 
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 agoTCP log: flush stream on every line
Amos Jeffries [Fri, 25 Mar 2011 09:05:41 +0000 (22:05 +1300)] 
TCP log: flush stream on every line

TCP logging has a buffer which can catch log traffic peaks.
per-line flushing is required to prevent the log data accumulating under
low loads.

14 years agobasic_ldap_auth: error message for missing credentials
Amos Jeffries [Fri, 25 Mar 2011 07:24:26 +0000 (20:24 +1300)] 
basic_ldap_auth: error message for missing credentials

14 years agoBug 3173: Assertion bodyPipe!=NULL on SslBump CONNECT response writing failure
Alex Rousskov [Thu, 24 Mar 2011 15:48:34 +0000 (09:48 -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 agoRegression fix: upgrade existing icons
Amos Jeffries [Thu, 24 Mar 2011 14:00:41 +0000 (03:00 +1300)] 
Regression fix: upgrade existing icons

This adds an automatic upgrade to move the old pre-3.2.0.5 icons into the
new icons area.
This also retains any local customizations that may have been done,
ie. new icons added outside Squid.

14 years agosignal.h is required before defining SA_* macros
Amos Jeffries [Wed, 23 Mar 2011 23:36:23 +0000 (11:36 +1200)] 
signal.h is required before defining SA_* macros

uncovered by LZZ precompiler.

14 years agoICC: useless code removals
Amos Jeffries [Wed, 23 Mar 2011 08:55:43 +0000 (20:55 +1200)] 
ICC: useless code removals

size_t is guaranteed to be >=0 so these checks are useless.

Also some optimization of the tunnel and whois comm result handling after
the size_t test changes.