]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
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.

14 years agoBug 3181: /dev/poll fails to build on Solaris with GCC 4.5.0
IIDA Yosiaki [Wed, 23 Mar 2011 01:54:22 +0000 (13:54 +1200)] 
Bug 3181: /dev/poll fails to build on Solaris with GCC 4.5.0

14 years agoMade cache.log less noisy about usually benign events outside of admin control.
Alex Rousskov [Wed, 23 Mar 2011 00:32:37 +0000 (18:32 -0600)] 
Made 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 agoPropagate details of ICAP errors happened after adapted HTTP header creation.
Alex Rousskov [Wed, 23 Mar 2011 00:18:28 +0000 (18:18 -0600)] 
Propagate details of ICAP errors happened after adapted HTTP header creation.

We used to update the virgin HTTP request with error details even after REQMOD
resulted in creation of a new/adapted HTTP request object. When the client
side replaced the old/virgin request headers with the new adapted request
object, the error details were lost and %err_detail was not logged to the
transaction log.

This is one more place where a Master Transaction object (with a shared error
detail field) should be extracted from the HttpRequest and persist throughout
the HTTP transaction lifetime.

14 years agoICC: dead code removal
Amos Jeffries [Tue, 22 Mar 2011 12:23:25 +0000 (01:23 +1300)] 
ICC: dead code removal

14 years agoFurther eCAP startup message polish
Amos Jeffries [Tue, 22 Mar 2011 06:24:14 +0000 (19:24 +1300)] 
Further eCAP startup message polish

14 years agoNot all time-based options should accept milliseconds
Christos Tsantilas [Fri, 18 Mar 2011 22:09:08 +0000 (00:09 +0200)] 
Not all time-based options should accept milliseconds

After last changes, squid  accepts "millisecond" units for all time-based
options, silently rounding millisecond-based values down if they are not
supported. We should not allow millisecond units for options that do not
support millisecond.
This patch add the allowMsec parameter to parseTimeLine function to allow/deny
the use of milliseconds.

14 years agoBug 3007: CONNECT to cache_peer returns 000 status code
Mikio Kishi [Fri, 18 Mar 2011 06:42:32 +0000 (19:42 +1300)] 
Bug 3007: CONNECT to cache_peer returns 000 status code

14 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 17 Mar 2011 00:12:57 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoRemove useless checks and debug. size_t is guaranteed to be signed
Amos Jeffries [Wed, 16 Mar 2011 12:03:03 +0000 (01:03 +1300)] 
Remove useless checks and debug. size_t is guaranteed to be signed

Detected by ICC.

14 years agoLanguage: hy\n
Arthur [Wed, 16 Mar 2011 11:03:39 +0000 (00:03 +1300)] 
Language: hy\n

14 years agoBug Fix: Squid may crash, when accessing an SSL certificate with errors
Christos Tsantilas [Wed, 16 Mar 2011 09:29:40 +0000 (11:29 +0200)] 
Bug Fix: Squid may crash, when accessing an SSL certificate with errors

This is a security bug.
The bug report is:
   When accessing a revoked certificate (i.e., X509_V_ERR_CERT_REVOKED) Squid
crashes. In ssl/ErrorDetail.cc:223 the detailed message is left blank if the
error is not specifically handled by Squid and the errorpage.cc:1193 assertion
fails while trying to convert the message.

This patch:
 - Handle inside ErrorState::Convert the cases where the ErrorDetail return
   blank error detail string
 - Use a default  detail error message in ssl::ErrorDetail, for the cases
   where the detail error is not defined in TheSslDetailMap.
 - If a name for the ssl::ErrorDetail error code is not defined return the
   numeric error code when the "%err_name" formating code used

14 years agoWrap time_msec parse functions properly
Amos Jeffries [Wed, 16 Mar 2011 06:47:15 +0000 (19:47 +1300)] 
Wrap time_msec parse functions properly

Parsers complain about unused functions.
These are currently only used by code wrapped in !USE_DNSSERVERS.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 16 Mar 2011 00:12:38 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoBug fix: Fix a formating code: should be %ssl_subject not %subject
Christos Tsantilas [Tue, 15 Mar 2011 22:35:51 +0000 (00:35 +0200)] 
Bug fix: Fix a formating code: should be %ssl_subject not %subject

14 years agoChange the default dns_timeout value from 2 minutes to 30 seconds
Christos Tsantilas [Tue, 15 Mar 2011 17:39:36 +0000 (19:39 +0200)] 
Change the default dns_timeout value from 2 minutes to 30 seconds

The related squid-dev discussion is here:
  http://www.mail-archive.com/squid-dev@squid-cache.org/msg15152.html

14 years agoConvert dns_timeout and dns_retransmit_interval configuration options to use millisec...
Christos Tsantilas [Tue, 15 Mar 2011 17:31:34 +0000 (19:31 +0200)] 
Convert dns_timeout and dns_retransmit_interval configuration options to use millisecond resolution.

One second resolution is too coarse for small timeouts in delay-sensitive
environments, especially when a retransmit, bypass, or another corrective
action is available and is likely to produce a positive outcome. In DNS world
specifically, most timeouts are measured in milliseconds.

This is a Measurement Factory project

14 years agoBug 3175: IPv6 PTR lookup crashes on raw-IP URLs when IPv6 disabled
Amos Jeffries [Mon, 14 Mar 2011 21:40:59 +0000 (15:40 -0600)] 
Bug 3175: IPv6 PTR lookup crashes on raw-IP URLs when IPv6 disabled

14 years agonegotiate_kerberos_auth update to version 3.0.4sq
Markus Moeller [Mon, 14 Mar 2011 06:15:51 +0000 (00:15 -0600)] 
negotiate_kerberos_auth update to version 3.0.4sq

Fixes a minor error in printing gss errors

14 years agoext_kerberos_ldap_group_acl version 1.3.0sq
Markus Moeller [Mon, 14 Mar 2011 06:08:24 +0000 (00:08 -0600)] 
ext_kerberos_ldap_group_acl version 1.3.0sq

14 years agoRemove redundant FTP/Gopher checks
Amos Jeffries [Sat, 12 Mar 2011 03:34:48 +0000 (16:34 +1300)] 
Remove redundant FTP/Gopher checks

Identified by ICC.

14 years agoICC build issue in ConnStateData::getConn
Amos Jeffries [Sat, 12 Mar 2011 01:16:37 +0000 (18:16 -0700)] 
ICC build issue in ConnStateData::getConn

ICC complains about:
"type qualifier on return type is meaningless
      inline ConnStateData * const getConn() const;
"

I believe this is const-correct. The incorrect version would be "& const"
But there is no harm in combining the two getConn() methods.

14 years agoSourceFormat: Moved Adaptation::Answer class to its dedicated source files.
Alex Rousskov [Fri, 11 Mar 2011 23:02:23 +0000 (16:02 -0700)] 
SourceFormat: Moved Adaptation::Answer class to its dedicated source files.

14 years agoMoved AccessLogEntry.headers.adapt_last to AccessLogEntry.adapt.last_meta
Alex Rousskov [Fri, 11 Mar 2011 22:38:29 +0000 (15:38 -0700)] 
Moved AccessLogEntry.headers.adapt_last to AccessLogEntry.adapt.last_meta

Added AccessLogEntry::AdaptationDetails to keep general adaptation-related
fields together and away from the HTTP fields.

14 years agoFixed propagation of eCAP transaction meta-information to core Squid
Alex Rousskov [Fri, 11 Mar 2011 22:22:13 +0000 (15:22 -0700)] 
Fixed propagation of eCAP transaction meta-information to core Squid
by synchronizing the history of the virgin and eCAP-adapted/cloned request.

If the request history is created after the request got cloned, the cloned
request will have no history unless we explicitly import the newly created
history. Hopefully, it is not possible for the cloned request to get its own,
diverging history before the import (we check and throw if that happens).

This is one more example why a MasterTransaction class (with history) needs
to be extracted and separated from the HttpRequest class.

14 years agoPolished SGML formatting.
Alex Rousskov [Fri, 11 Mar 2011 22:16:05 +0000 (15:16 -0700)] 
Polished SGML formatting.

14 years agoDocumented changes related to libecap v0.2.0 support.
Alex Rousskov [Fri, 11 Mar 2011 22:14:52 +0000 (15:14 -0700)] 
Documented changes related to libecap v0.2.0 support.

14 years agoGrouped methods related to the same API and documented which API they implement
Alex Rousskov [Fri, 11 Mar 2011 21:57:27 +0000 (14:57 -0700)] 
Grouped methods related to the same API and documented which API they implement

14 years agoReport eCAP service [re]start to cache.log by default.
Alex Rousskov [Fri, 11 Mar 2011 21:41:33 +0000 (14:41 -0700)] 
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 agoFixed send_username typo. The correct option name is adaptation_send_username.
Alex Rousskov [Fri, 11 Mar 2011 21:37:32 +0000 (14:37 -0700)] 
Fixed send_username typo. The correct option name is adaptation_send_username.

14 years agoExpand Makefile sources macros
Amos Jeffries [Fri, 11 Mar 2011 15:11:11 +0000 (08:11 -0700)] 
Expand Makefile sources macros

Expand several macros used in earlier attempts to omtimize the Makefile
content. With the SourceLayout and modular changes underway these are
proving to be more of a problem than they are worth.

At some future time when the convenience libraries are settled it may be
worth revisiting some shared lists. But not yet.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 11 Mar 2011 01:12:39 +0000 (18:12 -0700)] 
SourceFormat Enforcement

14 years agoApply uri_whitespace before logging malformed requests
Christos Tsantilas [Thu, 10 Mar 2011 13:10:40 +0000 (15:10 +0200)] 
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 agoproto ACL overly verbose on "Ignoring unknown protocol"
Amos Jeffries [Thu, 10 Mar 2011 12:32:42 +0000 (01:32 +1300)] 
proto ACL overly verbose on "Ignoring unknown protocol"

Minor logic error in display. No actual operational effects.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 10 Mar 2011 01:12:44 +0000 (18:12 -0700)] 
SourceFormat Enforcement

14 years agoSupport libecap v0.2.0; fixed eCAP body handling and logging.
Alex Rousskov [Wed, 9 Mar 2011 19:26:18 +0000 (12:26 -0700)] 
Support libecap v0.2.0; fixed eCAP body handling and logging.

Summary of changes:

libecap v0.2.0 support: accept/update/log eCAP transaction meta-info.
libecap v0.2.0 support: supply client IP and username to eCAP adapter.
libecap v0.1.0 support: Support blockVirgin() API with ERR_ACCESS_DENIED.

Use pkg-config's PKG_CHECK_MODULES to check for and link with libecap.

Support adapter-specific parameters as a part of ecap_service configuration.
Allow uri=value parameter when specifying adaptation service URIs.

Fixed virgin body handling in our eCAP transaction wrapper (Ecap::XactionRep).
Fixed BodyPipe.cc:144 "!theConsumer" assertion.

Log "important" messages from eCAP adapters with DBG_IMPORTANT not DBG_DATA!

Added XXXs to identify old unrelated problems to be fixed separately.

14 years agoMerged from parent (trunk 11270, circa 3.2.0.5+)
Alex Rousskov [Wed, 9 Mar 2011 19:02:12 +0000 (12:02 -0700)] 
Merged from parent (trunk 11270, circa 3.2.0.5+)

14 years agoGive full Request-URI to eCAP adapters.
Alex Rousskov [Wed, 9 Mar 2011 17:52:15 +0000 (10:52 -0700)] 
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 agoBug 2621: Provide request headers to RESPMOD when using cache_peer.
Alex Rousskov [Wed, 9 Mar 2011 17:44:55 +0000 (10:44 -0700)] 
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 agoImport external libecap in adaptation/ecap/, where it belongs.
Alex Rousskov [Wed, 9 Mar 2011 17:39:02 +0000 (10:39 -0700)] 
Import external libecap in adaptation/ecap/, where it belongs.
Either we finally found the working combination of libtool variables or the
previous attempts were failing due to libtool confusion over leftovers in
the build directory (or we will discover more build failures later!).

Polished libecap-related Makefile variable names based on squid-dev review.

14 years agoPolished to address Squid Project review comments.
Alex Rousskov [Tue, 8 Mar 2011 23:56:22 +0000 (16:56 -0700)] 
Polished to address Squid Project review comments.

14 years agoIDNS missing casts
Amos Jeffries [Sun, 6 Mar 2011 11:48:16 +0000 (00:48 +1300)] 
IDNS missing casts

14 years agoMake DNS report failure on all packet construction errors
Amos Jeffries [Sat, 5 Mar 2011 06:00:08 +0000 (23:00 -0700)] 
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 agoBug 2976: invalid URL on intercepted requests during reconfigure
Amos Jeffries [Sat, 5 Mar 2011 02:00:32 +0000 (19:00 -0700)] 
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 agoSourceFormat Enforcement
Automatic source maintenance [Sat, 5 Mar 2011 01:12:33 +0000 (18:12 -0700)] 
SourceFormat Enforcement

14 years agoRFC 1738 encoder upgraded action flags
Amos Jeffries [Sat, 5 Mar 2011 00:32:41 +0000 (13:32 +1300)] 
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 agoSourceFormat Enforcement
Automatic source maintenance [Fri, 4 Mar 2011 01:12:39 +0000 (18:12 -0700)] 
SourceFormat Enforcement

14 years agoBug 2885: Compile errors on AIX
Amos Jeffries [Thu, 3 Mar 2011 15:41:54 +0000 (04:41 +1300)] 
Bug 2885: Compile errors on AIX

Support AIX unusual definition of in_addr/in6_addr unions.

14 years agoFix typos and missing if in libTrie inline support.
Amos Jeffries [Thu, 3 Mar 2011 14:02:10 +0000 (03:02 +1300)] 
Fix typos and missing if in libTrie inline support.

14 years agoCorrect debug statement about non-IPs on parse
Amos Jeffries [Thu, 3 Mar 2011 12:56:51 +0000 (01:56 +1300)] 
Correct debug statement about non-IPs on parse

14 years agoBug 2965: Compile errors on MinGW
Cephas [Thu, 3 Mar 2011 12:20:58 +0000 (01:20 +1300)] 
Bug 2965: Compile errors on MinGW

14 years agoSourceLayout: protocol_t upgrade fix
Christos Tsantilas [Thu, 3 Mar 2011 10:40:16 +0000 (12:40 +0200)] 
SourceLayout: protocol_t upgrade fix

The proto acls does not work due to a mistyped strcasecmp if check

14 years agoFix Solaris warning: strands hides Ipc::Inquirer::strands
Amos Jeffries [Thu, 3 Mar 2011 04:31:33 +0000 (17:31 +1300)] 
Fix Solaris warning: strands hides Ipc::Inquirer::strands

14 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 3 Mar 2011 01:18:42 +0000 (18:18 -0700)] 
SourceFormat Enforcement

14 years agoAdd support for parameterized Cache Manager queries, compile errors fix
Christos Tsantilas [Wed, 2 Mar 2011 22:36:51 +0000 (00:36 +0200)] 
Add support for parameterized Cache Manager queries, compile errors fix

The regex.h file if required included in compat.h file, must not used directly
in squid sources

14 years agoUpdate PROTO_CACHEOBJ to PROTO_CACHE_OBJECT name
Amos Jeffries [Wed, 2 Mar 2011 20:43:21 +0000 (13:43 -0700)] 
Update PROTO_CACHEOBJ to PROTO_CACHE_OBJECT name

Also catches several eCAP uses which were missed.

14 years agoAdd support for parameterized Cache Manager queries fix warnings in CentOS 5.3 amd64
Christos Tsantilas [Wed, 2 Mar 2011 19:27:09 +0000 (21:27 +0200)] 
Add support for parameterized Cache Manager queries fix warnings in CentOS 5.3 amd64

14 years agoAdd support for parameterized Cache Manager queries.
Christos Tsantilas [Wed, 2 Mar 2011 18:53:06 +0000 (20:53 +0200)] 
Add support for parameterized Cache Manager queries.

Currently, one sends mgr queries to the "whole" Squid. Kids responses may get
aggregated by Coordinator, and we, in general, want to aggregate all responses
that can be aggregated.

This patch allow us to aggregate stats for a subset of kids. For example,
the following query aggregates stats for just the first and the third workers:

    mgr:info?workers=1,3

When query response information cannot be aggregated (or at least is not
aggregated right now), then a parameterized query will result in several
matching "byKid { ..." blocks.

This patch support the following scope variants:

    * raw interface with access to any kid process or groups of kids; similar
      to ${process_number} macro we already support in squid.conf:
          mgr:foo?processes=id,id,id...
    * higher-level interface to isolate workers by their numbers, starting
      with 1 for the first worker:
          mgr:foo?workers=num,num,num...

Currently, all kids except Coordinator are workers, but that will change in
the future as we get more kinds of kids.Currently, one sends mgr queries
to the "whole" Squid. Kids responses may get aggregated by Coordinator,
and we, in general, want to aggregate all responses that can be aggregated.

This is a Measurement Factory project