Honor 0x and 0 prefixes as numeric base indication when parsing squid.conf integer options.
Author: Alex Rousskov <rousskov@measurement-factory.com>
Squid3 parses squid.conf file integers as decimal numbers while Squid2 honors
0 and 0x prefixes (indicating octal and hex numbers). The later functionality
is needed for things like unmask that are traditionally specified using octal
format.
This patch changes Squid3 behavior to match that of Squid2.
Internally, Squid3 uses sscanf and Squid2 uses strtol.
TODO: Squid3::GetInteger should probably use xatol,
and xatol should be fixed to proper verify the result of strtol.
Amos Jeffries [Fri, 14 Mar 2008 04:45:16 +0000 (17:45 +1300)]
Bug #1634: no Proxy-Authenticate header in 407 responses
This is a temporary fix partially reversing the fix for bug 1923.
It is likely to be superseded in future releases. It is intended only to
restore critical previous behaviour to squid as a short-term measure.
amosjeffries [Wed, 27 Feb 2008 18:24:18 +0000 (18:24 +0000)]
Author: rousskov
Added a CPPUNIT assertion to test whether a failed CPPUNIT test case properly
destructs local objects on exit.
If a previous test case fails for any reason, the new assertion will fail
instead of store_dir.cc aborting. This may save us from tracking non-existent
StoreController initialization bugs.
amosjeffries [Wed, 27 Feb 2008 17:47:59 +0000 (17:47 +0000)]
Several String fixes.
- Add two missing includes when configured --disable-inline
- SegFault when newly allocated string set to 0-length.
buf_ may be NULL and buffer overruns on truncate attempt
amosjeffries [Wed, 27 Feb 2008 17:45:50 +0000 (17:45 +0000)]
Author: rousskov
The connect(2) system call might return "connection ready"
status even for a non-blocking file descriptor. The connection
itself can never be immediately ready in reality because of the
TCP handshake, but I am guessing that in some environments, the
TCP stack fakes/optimizes local connection readiness. We have
seen that for loopback sockets on FreeBSD 6.2, for example, but
the behavior is probably OS- or OS-configuration specific.
If connect(2) is immediately successful, comm module
immediately calls the callback. This means that the callback is
called while the same callback is being registered with comm.
ICAP does not allow this "re-entrance" and other code might not
deal well with it.
The change overwrites connect(2) result so that Squid does not
think that connect(2) was immediately successful. Instead of
calling the callback, Squid then schedules the connection
write-ability check.
The NativeAsyncCall development will fix this and remove the
need to overwrite connect(2) result because comm will always
call callbacks asynchronously.
amosjeffries [Wed, 27 Feb 2008 17:43:56 +0000 (17:43 +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.
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.
amosjeffries [Wed, 27 Feb 2008 17:41:16 +0000 (17:41 +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, 27 Feb 2008 12:51:04 +0000 (12:51 +0000)]
Author: hno
New myportname ACL for matching the accepting port name
- also documents the name= port option which was previously implemented but unused
- Mention the new myportname acl in the acl section
- Document the addition of myportname acl
amosjeffries [Tue, 26 Feb 2008 07:04:15 +0000 (07:04 +0000)]
Author: hno
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 [Mon, 25 Feb 2008 10:41:38 +0000 (10:41 +0000)]
Author: hno
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
amosjeffries [Mon, 25 Feb 2008 10:39:02 +0000 (10:39 +0000)]
Author: hno
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.
amosjeffries [Mon, 25 Feb 2008 09:45:50 +0000 (09:45 +0000)]
Author: hno
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..
amosjeffries [Sun, 24 Feb 2008 18:28:09 +0000 (18:28 +0000)]
Author: hno
Accept some unknown store meta entries without throwing away the rest.
The store meta parser stopped when encountering the first "unknown" entry.
This is bad for extensibility. Should continue parsing what we do know
how to handle.
serassio [Wed, 20 Feb 2008 03:14:49 +0000 (03:14 +0000)]
Author: Klaubert Herr <klaubert@gmail.com>
Patch to strip kerberos realm from username
This patch add a new option to squid_ldap_group to strip kerberos realm from
username received from squid.
This is useful when you make kerberos authentication on squid, and try to
authorize the user using ldap in MS Active Directory, quering for
sAMAccountName.
serassio [Sun, 17 Feb 2008 18:32:22 +0000 (18:32 +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 [Wed, 6 Feb 2008 13:54:40 +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