swilton [Sat, 9 Feb 2008 10:48:05 +0000 (10:48 +0000)]
Author: Steven Wilton <swilton@q-net.net.au>
Sort cache list in wccpv2 to ensure a consistent hash allocation across all serv
ices
Under some circumstances different caches were being allocated differnet hash
assignments for different wccpv2 services. This caused problems when using
TPROXY as the reply traffic was being sent to a different cache than the request
causing problems in browsing web pages.
This patch applied a selection sort algorithm to the cache list to ensure that
as long as the same group of caches are registered for any number of wccpv2
services, they will be allocated the same hash assignments in the router.
rousskov [Sat, 9 Feb 2008 01:31:02 +0000 (01:31 +0000)]
Bug 2038: check reply_body_max_size before ICAP
Use newly added HttpReply::*BodyTooLarge() checks to support the
reply_body_max_size ACL when the expected body size may be known and when more
body data is coming. The checks are now shared between server and client
sides.
The server side needs to do the checks before feeding the data to ICAP.
Otherwise, ICAP service may suck a large response in and spit a small response
out. It was decided that the reply_body_max_size ACL should apply to the
virgin response as well.
The server side does not perform receivedBodyTooLarge check yet.
rousskov [Sat, 9 Feb 2008 01:30:18 +0000 (01:30 +0000)]
Bug 2038: check reply_body_max_size before ICAP
Use newly added HttpReply::expectedBodyTooLarge() check to support the
reply_body_max_size ACL when the expected body size may be known. The check
is now shared between server and client sides.
The server side needs to do the checks before feeding the data to ICAP.
Otherwise, ICAP service may suck a large response in and spit a small response
out. It was decided that the reply_body_max_size ACL should apply to the
virgin response as well.
The server side does not perform HttpReply::receivedBodyTooLarge() check yet.
rousskov [Sat, 9 Feb 2008 01:27:59 +0000 (01:27 +0000)]
Bug 2038: check reply_body_max_size before ICAP
Moved maxReplyBodySize-related code from ClientHttpRequest to HttpReply
because server-side needs it too to check limits before ICAP sucks all the
data in.
Calculating limit requires knowing HttpRequest because it affects expected
content length. Since I did not find a single place where any HttpReply would
be guaranteed to be given the request to calculate the limit, we now supply
the request whenever a limit check is performed. The limit calculation result
is cached and the calculation should not be repeated.
checkRetry is now guaranteed to return false for requests that checkRetriable
previously returned false. This prevents retries of requests with
non-idempotent methods, for example.
rousskov [Fri, 8 Feb 2008 01:16:24 +0000 (01:16 +0000)]
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
Bug 2172: When user fails authentification Squid restarts
Replaced an assertion that there is no auth_user_request, a comment what
to do when there is no auth_user_request, and a comment that there can
be no auth_user_request with what the first comment suggested to do.
amosjeffries [Wed, 6 Feb 2008 13:54:14 +0000 (13:54 +0000)]
Alter caching policy for Dynamic Objects.
- Alters squid caching policy for dynamically generated objects
to allow caching when objects have Cache-Control headers.
- Default policy now follows RFC 2616 section 13.9 exactly as stated.
see http://www.mail-archive.com/squid-dev@squid-cache.org/msg06963.html
amosjeffries [Sun, 3 Feb 2008 17:00:29 +0000 (17:00 +0000)]
Fixes many Unit-test compile errors and testing problems in HttpRequestMethod
- Removes implicit conversion from HttpRequestMethod to other types.
- Adds id() accessor to retrieve an ID for known methods.
- Adds more boolean operators to class library
Also adds auto-documantation in some METHOD-related places.
serassio [Fri, 25 Jan 2008 02:20:43 +0000 (02:20 +0000)]
Windows port: Handle notification of IP address changes for dial-up connections
On Windows 2000 and later, the NotifyAddrChange() function allow a
process to be notified of the changes in the system IP addresses table.
This patch generate a reconfigure request after any notification, this
allow the hot addition/reconfiguration of network interfaces without
manually restart/reconfigure Squid.
amosjeffries [Thu, 24 Jan 2008 03:51:16 +0000 (03:51 +0000)]
Protect String::limitInit() against empty strings.
Is being caleld at least once in squid3 with a NULL ptr and 0 length.
This patch prevents memory allocation on 0 length and a will continue
to assert if a NULL pointer is given with a length.
(We may want to re-think that later)
rousskov [Thu, 24 Jan 2008 02:24:14 +0000 (02:24 +0000)]
String 'call duplication' optimization(?) bypassed calling String::init()
when copying a String and called limitInit() directly. That results in
an assertion when an empty String is copied. The fix avoids calling
limitInit() when an empty String is copied.
rousskov [Wed, 23 Jan 2008 03:54:28 +0000 (03:54 +0000)]
Bug 2168 fix: Avoid tcp_outgoing_address selection for ICAP requests.
Let OS pick the outgoing (i.e., source) address instead.
Code did not supply info required for tcp_outgoing_address ACL match to work,
and tcp_outgoing_address is usually not applicable to ICAP communication.
Eventually, we may add icap_outgoing_address.
amosjeffries [Sat, 19 Jan 2008 14:15:28 +0000 (14:15 +0000)]
EPSV support for FTP and other fixes.
- Adds full EPSV method support for FTP server connections
- Fixes debugging in FTP state machine into specific levels:
* 0: critical problems
* 1: non-critical problems
* 2: FTP protocol chatter
* 3: FTP logic flow debugging
* 5: FTP data parsing flows
- Adds code documentation to some FTP functions.
amosjeffries [Sat, 19 Jan 2008 14:11:34 +0000 (14:11 +0000)]
Miscenllaneous fixes for CNAME, include, and comm.
- Add more wrapping of CNAME code no longer needed.
- Fixes typo in include directive ported code.
- Fixes incorrect socket family setting on some accepted connections.
hno [Mon, 14 Jan 2008 19:13:49 +0000 (19:13 +0000)]
Bug #2153: Use the cache_peer name in CARP hashing to support multiple peers on the same host
The cache_peer name= option was introduced some years ago to allow
peers to be named and to suppot multiple peers on the same host/address.
However, carp still used the hostname/address and not the name making
it fail slightly when forwarding to multiple peers on the same address.
amosjeffries [Fri, 11 Jan 2008 12:04:02 +0000 (12:04 +0000)]
Formal Debug Levels part 1 - Define names for some debug levels.
This allows the use of DBG_CRITICAL and DBG_IMPORTANT instead of magic
numbers 0 and 1 in the debugs() calls. Making code a little more readable
and easier to use. The code itself is not modified to use them yet.
DBG_DATA is added for level 9, though that may change.
TODO: the other levels (2-8) still need deciding. No consensus was reached
amongst the developers for those levels when discussed.
amosjeffries [Fri, 11 Jan 2008 10:49:18 +0000 (10:49 +0000)]
AAAA/A failover fix and CNAME recursion deprecation
A bug in the final version of squid internal DNS resolver logics
caused any failover A results to overwrite the paired previous AAAA.
This patch adds state to store the DNS results between failover queries
and to merge the final sets before passing them out to the requestor.
Lookups should now be seemlessly handled within the DNS resolver stub.
CNAME recursion at the ipcache level should now be obsolete and has been
wrapped in a new ./configure --with-dns-cname option which defaults off.
That code has proven to be problematic anyway and will be no great loss.
Additional counters have been added to the squid statistics to track the
amount of queries of each type have been encountered.
hno [Mon, 7 Jan 2008 22:47:08 +0000 (22:47 +0000)]
Bug #2175: Update valgrind support for valgrind-3.3.0
Valgrind memcheck rearranged the names of it's support macros in
version 3.2.0 to better represent the actual function, and now the
old names has been removed starting with version 3.3.0 causing
build a failure if --with-valgrind-debug is used.
this patch updates Squid to use the new valgrind macro names, and
adds a little glue to be compatible with older valgrind versions
hno [Sun, 30 Dec 2007 11:06:30 +0000 (11:06 +0000)]
Random authenticaiton failures when using Digest authentication
The stale= propery of the Digest responses sent by Squid indicated far
too often that the nonce was not stale. Contrary to what the RFC recommends
we should only say that the nonce is not stale when it is a valid nonce but
the response did not compute (invalid user or password). In all other
situations we should say that the nonce is stale even if we haven't
validated the response.
hno [Thu, 27 Dec 2007 22:48:53 +0000 (22:48 +0000)]
Remove the default cache_dir location and the null store type
Many people gets confused by the builtin cache_dir location, thinking
that if there is no cache_dir in squid.conf then there is no on-disk cache.
This removes the builtin default.
By removing the builtin default we can also remove the "null" cache_dir
type whos purpose is only to override the builtin default.
hno [Thu, 27 Dec 2007 21:55:47 +0000 (21:55 +0000)]
netdb_filename directive to specify location of netdb state file
was hardcoded to use the first cache_dir. This moves the default location
to the logs directory and may be overridden at compile time by setting
DEFAULT_NETDB_FILE
hno [Thu, 27 Dec 2007 08:58:19 +0000 (08:58 +0000)]
Bug #2114: cache memory accounting not working well
Use the page allocator statistics to report cache_mem usage
This patch removes the weak attempt in keeping an byte-exact cache_mem usage
counter, instead using the actual allocated size (but excluding overhead).
This is the same accounting method as used in Squid-2 btw..