]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
13 years agoOptimize regular expression ACLs
Mrcus Kool [Tue, 9 Aug 2011 07:09:03 +0000 (01:09 -0600)] 
Optimize regular expression ACLs

This patch is inspired by the work that I did for ufdbGuard and a few emails with Amos.

The new code optimises lists of regular expressions.

The optimisations are:
* initial .* is stripped
* RE-1 RE-2 ... RE-n are joined into one large RE: (RE-1)|(RE-2)|...|(RE-n)
* -i ... -i options are optimised: the second one is ignored, same for +i

If compounding optimization fails it falls back to using unoptimized
expressions.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 9 Aug 2011 00:12:17 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agocf_gen.cc fix: include errno.h
Francesco Chemolli [Mon, 8 Aug 2011 21:43:52 +0000 (23:43 +0200)] 
cf_gen.cc fix: include errno.h

13 years agoImprove error reporting in cf_gen.cc
Francesco Chemolli [Mon, 8 Aug 2011 19:12:16 +0000 (21:12 +0200)] 
Improve error reporting in cf_gen.cc

13 years agoMigrate cf_gen.cc from C-style stdio to C++ iostreams.
Francesco Chemolli [Mon, 8 Aug 2011 16:05:17 +0000 (18:05 +0200)] 
Migrate cf_gen.cc from C-style stdio to C++ iostreams.

13 years agoRevert rev.11620. Fix unit tests instead of dropping.
Amos Jeffries [Mon, 8 Aug 2011 00:38:41 +0000 (12:38 +1200)] 
Revert rev.11620. Fix unit tests instead of dropping.

Rather than dropping the unit tests if IPv4 state change them to match
the new assumptions that a fresh initialized address object is IPv6-only.

13 years agoRemove hierarchy_stoplist default value
Amos Jeffries [Mon, 8 Aug 2011 00:21:01 +0000 (12:21 +1200)] 
Remove hierarchy_stoplist default value

This should have been done long ago with the other dynamic website
handling changes. It has caused a certain amount of confusion when things
which apparently should go to peers fail to reach them.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 8 Aug 2011 00:12:19 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years ago"make check" after the isAnyAddr patch fails to compile
Christos Tsantilas [Sun, 7 Aug 2011 12:21:57 +0000 (15:21 +0300)] 
"make check" after the isAnyAddr patch fails to compile

An empty IP address is an IPv6 noaddr address now

13 years agoauthor: Christos Tsantilas <chtsanti@users.sourceforge.net>, Amos Jeffries <squid3...
Christos Tsantilas [Sun, 7 Aug 2011 10:26:09 +0000 (13:26 +0300)] 
author: Christos Tsantilas <chtsanti@users.sourceforge.net>, Amos Jeffries <squid3@treenet.co.nz>
Bug fix: The Ip::Address::IsAnyAddr method return false for IPv4 anyaddr.

 - The ip::Address::IsAnyAddr() returns true only for ipv6 anyaddr
   (0000:0000:0000:0000:0000:0000:0000:0000) and returns false when we have an
   ipv4 anyaddr (0000:0000:0000:0000:0000:FFFF:0000:0000)

 - The ip::Address::IsIPv4 method returns false in the case of IPv4 anyaddr.

The above can cause bugs, eg:
 - inside Ip::Address::SetIPv4(). When it is called for an IPv6 anyaddr the ip
   address will  not considred as anyaddr any morei (it IsAnyAddr will return
   false).

 - inside cache_cf.cc file inside dump_generic_http_port function:
   if (s->s.IsAnyAddr() && !s->s.IsIPv6())
        storeAppendPrintf(e, " ipv4");
   The if condition in the above statement can never be true. But the s->s can
   be an ipv4 anyaddr.

 - other places where the code will not work as expected in the case we are
   listening to an ipv4 anyaddr ip address.

This patch:
  - moving the IsIPv4/6 to base purely on the v4-mapped or not
  - making both protocols ANYADDR match the same test
  - making both protocols NOADDR match the same test
  - Fixing the IsIPv4/6 documentation to match the implementation

13 years agoWindows: sys_nerr is not available on MinGW.
Francesco Chemolli [Sun, 7 Aug 2011 09:56:35 +0000 (21:56 +1200)] 
Windows: sys_nerr is not available on MinGW.

13 years agosquidclient: build errors on Windows
Amos Jeffries [Sun, 7 Aug 2011 09:37:18 +0000 (21:37 +1200)] 
squidclient: build errors on Windows

13 years agoWindows: merge WIN32_strerror() and wsastrerror() into xstrerr()
Amos Jeffries [Sun, 7 Aug 2011 09:29:11 +0000 (21:29 +1200)] 
Windows: merge WIN32_strerror() and wsastrerror() into xstrerr()

13 years agoWindows: shuffle win32lib into libcompat
Amos Jeffries [Sun, 7 Aug 2011 09:22:28 +0000 (21:22 +1200)] 
Windows: shuffle win32lib into libcompat

13 years agoPortability: several issues in MinGW
Amos Jeffries [Sat, 6 Aug 2011 03:45:38 +0000 (15:45 +1200)] 
Portability: several issues in MinGW

13 years agoPortability: fix windows socket lirary detection
Francesco Chemolli [Sat, 6 Aug 2011 02:43:50 +0000 (14:43 +1200)] 
Portability: fix windows socket lirary detection

13 years agoKill one goto
Amos Jeffries [Thu, 4 Aug 2011 06:27:17 +0000 (18:27 +1200)] 
Kill one goto

13 years agoSourceLayout: format namespace for custom tag-based formats
Amos Jeffries [Thu, 4 Aug 2011 03:21:06 +0000 (21:21 -0600)] 
SourceLayout: format namespace for custom tag-based formats

Part 1 of enabling non-logging components to support custom formats in strings

Shuffle the log custom format code into its own library separate from the
logging functionality.

One minor logic change removing redundant LogFileEnabled flag.

TODO:
 - use MemBuf instead or as well as StoreEntry as the output buffer
 - separate from AccessLogEntry confusion
 - upgrade deny_info URL generation format
 - upgrade external_acl_type format
 - add custom helper formats

13 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 4 Aug 2011 00:13:34 +0000 (18:13 -0600)] 
SourceFormat Enforcement

13 years agoRe-enable revno11514. Host: verification now done
Amos Jeffries [Wed, 3 Aug 2011 12:52:39 +0000 (06:52 -0600)] 
Re-enable revno11514. Host: verification now done

13 years agoBug 3243: CVE-2009-0801 Bypass of browser same-origin access control in intercepted...
Amos Jeffries [Wed, 3 Aug 2011 12:35:41 +0000 (06:35 -0600)] 
Bug 3243: CVE-2009-0801 Bypass of browser same-origin access control in intercepted communication

Add a verify step between header parsing and http_access to validate that the
Host: header matches the URL for forward-proxied traffic or the destination
IP:port for intercepted traffic.

This is part 1 of the CVE protections. The validation step required to detect
forgery and protect against cache poisoning.

13 years agoauthor: Measurement Factory
Christos Tsantilas [Wed, 3 Aug 2011 08:30:00 +0000 (11:30 +0300)] 
author: Measurement Factory
Bug 3118: ecap_enable on forces icap_enable on

We were updating [Icap|Ecap]::TheConfig even when [icap|ecap]_enable was false,
which may lead to service activation for Icap or Ecap services that should be
disabled. The patch removes such services from service groups before they are
activated.

The patch also warns the user when an adaptation group loses some but not all
of its services due to the new group cleanup code.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 3 Aug 2011 00:16:42 +0000 (18:16 -0600)] 
SourceFormat Enforcement

13 years agoSupport C++0x features where possible
Amos Jeffries [Tue, 2 Aug 2011 07:31:53 +0000 (19:31 +1200)] 
Support C++0x features where possible

This tests for and enables -std=c++0x compiler support on build.

Due to auto_ptr deprecation pieces of the code and a hack to work
around incompatible cppunit code, are converted to use unique_ptr.

When C++0x is available it also tests and uses the nullptr definition
for extra type safety.

13 years agoAdd support for using custom keys in CARP parents
Francesco Chemolli [Tue, 2 Aug 2011 05:15:45 +0000 (07:15 +0200)] 
Add support for using custom keys in CARP parents

Add a new carp-key option to CARP parents, specifying what parts of an URL
to use in the parent selection algorithm.

13 years agoFix signed/unsigned comparison
Amos Jeffries [Sat, 30 Jul 2011 03:14:25 +0000 (15:14 +1200)] 
Fix signed/unsigned comparison

13 years agoSourceLayout: Basic auth: shuffle helper request functions
Amos Jeffries [Sat, 30 Jul 2011 01:34:25 +0000 (19:34 -0600)] 
SourceLayout: Basic auth: shuffle helper request functions

helper lookup functions are AuthBasicUserRequest members. Should be in
that classes .cc file.

Also merge submit and queue functions. no need to be separate.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 30 Jul 2011 00:12:59 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoSourceLayout: generic AnyP::ProtocolVersion tag class
Amos Jeffries [Fri, 29 Jul 2011 13:12:29 +0000 (07:12 -0600)] 
SourceLayout: generic AnyP::ProtocolVersion tag class

Protocol agnostic class to store the request-line version details.
HTTP/1.0, HTTP/1.1, ICY/1.0, WebSockets/1.0 etc

For patch reduction leaves HttpVersion as a child class for HTTP/*.* tags

13 years agoTypo in certificate_db.cc
Amos Jeffries [Fri, 29 Jul 2011 13:02:10 +0000 (01:02 +1200)] 
Typo in certificate_db.cc

13 years agoBug 2655: passing wrong the username to the url_rewrite_program
Oliver Dumschat [Fri, 29 Jul 2011 05:53:35 +0000 (23:53 -0600)] 
Bug 2655: passing wrong the username to the url_rewrite_program

13 years agoDebug enhancements for rewrite helper user
Amos Jeffries [Thu, 28 Jul 2011 13:01:05 +0000 (01:01 +1200)] 
Debug enhancements for rewrite helper user

13 years agoauthor: Alex Rousskov <rousskov@measurement-factory.com>
Christos Tsantilas [Thu, 28 Jul 2011 09:25:42 +0000 (12:25 +0300)] 
author: Alex Rousskov <rousskov@measurement-factory.com>
Bug 3138: squidclient mgr:objects/mgr:vm_objects never ends

13 years agoBug 3131:fd_table[fd].closing() assert from ConnStateData::noteMoreBodySpaceAvailable()
Alex Rousskov [Thu, 28 Jul 2011 06:04:55 +0000 (18:04 +1200)] 
Bug 3131:fd_table[fd].closing() assert from ConnStateData::noteMoreBodySpaceAvailable()

13 years agoicp clean-up and ipv6/ipv4 related fixes
Christos Tsantilas [Wed, 27 Jul 2011 13:38:06 +0000 (16:38 +0300)] 
icp clean-up and ipv6/ipv4 related fixes

- The  "Sender Host Address" field of the ICP messages header it is a 32bit
  integer so it can be only an ipv4 ip address. Moreover according the ICP RFC:

  "Sender Host Address
     The IPv4 address of the host sending the ICP message.  This field
     should probably not be trusted over what is  provided by getpeer-
     name(), accept(), and recvfrom().  There is some ambiguity over
     the original purpose of this field.  In practice it is not used."

  This patch set the "Sender Host Address" field always to 0.

- Remove the echo_hdr static variable from neighbors.cc file and the
  theIcpPublicHostID variables from the icp_v2.cc file. They are part of the
  old "source_ping" squid feature code which does not exist any more.

- Remove the theIcpPrivateHostID variable from the icp_v2.cc file. It was used
  only to set the "Sender Host Address" icp message header field.

13 years agoDisplay HTTP protocol syntax at section 11 level 2
Amos Jeffries [Wed, 27 Jul 2011 12:15:49 +0000 (00:15 +1200)] 
Display HTTP protocol syntax at section 11 level 2

This enables easy debugging of what HTTP requests and replies are flowing
over the between Squid and external clients/servers. Avoiding the need
for level-9 debug traces or packet-level deciphering.

13 years agoReorder accel mode options a bit
Henrik Nordstrom [Wed, 27 Jul 2011 01:41:00 +0000 (03:41 +0200)] 
Reorder accel mode options a bit

reorder http_port accel mode options to group URL reconstruction
from other tuning options

also update https_port to refer to http_port for other options
to avoid duplicating.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 27 Jul 2011 00:12:59 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoDefault to vhost for accelerator mode (reverse proxy)
Amos Jeffries [Tue, 26 Jul 2011 23:09:58 +0000 (11:09 +1200)] 
Default to vhost for accelerator mode (reverse proxy)

Defaults to match HTTP requirements, and Host awareness is a
rather strong HTTP/1.1 requirement. The default in HTTP/1.1 is to read
the Host header (unless URL is absolute) but a server MAY optionally
ignore the Host header if desired.

The option no-vhost is provided to disable this behaviour if necessary.

13 years agoBug 3232: fails to compile with OpenSSL v1.0.0
Christos Tsantilas [Tue, 26 Jul 2011 05:53:32 +0000 (17:53 +1200)] 
Bug 3232: fails to compile with OpenSSL v1.0.0

13 years agocorrect printf formatting. purge debugFlag is an unsigned int, not a short
Henrik Nordstrom [Mon, 25 Jul 2011 22:31:04 +0000 (00:31 +0200)] 
correct printf formatting. purge debugFlag is an unsigned int, not a short

13 years agohelper_stateful_server is a class these days, not a struct
Henrik Nordstrom [Mon, 25 Jul 2011 22:29:28 +0000 (00:29 +0200)] 
helper_stateful_server is a class these days, not a struct

13 years agoCorrect memset size when clearing wccp assign message buffer
Henrik Nordstrom [Mon, 25 Jul 2011 22:23:09 +0000 (00:23 +0200)] 
Correct memset size when clearing wccp assign message buffer

13 years agoUse only standard printf length specifiers. Z is not one of them.
Henrik Nordstrom [Mon, 25 Jul 2011 22:17:24 +0000 (00:17 +0200)] 
Use only standard printf length specifiers. Z is not one of them.

13 years agosilence if assignment warning
Henrik Nordstrom [Mon, 25 Jul 2011 13:15:24 +0000 (15:15 +0200)] 
silence if assignment warning

13 years agoSimplify SASL config.test. If headers are there then
Henrik Nordstrom [Mon, 25 Jul 2011 13:12:53 +0000 (15:12 +0200)] 
Simplify SASL config.test. If headers are there then
it's reasonable to expect libs as well being present.

Note: not all archs places libs in /lib /usr/lib and
full searching is overkill.

13 years agoev_entry is a C++ class these days, don't attempt using it as a struct
Henrik Nordstrom [Mon, 25 Jul 2011 13:11:49 +0000 (15:11 +0200)] 
ev_entry is a C++ class these days, don't attempt using it as a struct

13 years agoKill last remaining auth_user_hash_pointer typedef usage
Henrik Nordstrom [Mon, 25 Jul 2011 13:10:17 +0000 (15:10 +0200)] 
Kill last remaining auth_user_hash_pointer typedef usage

13 years agoPrep for 3.2.0.10
Amos Jeffries [Sun, 24 Jul 2011 04:27:32 +0000 (22:27 -0600)] 
Prep for 3.2.0.10

13 years agoProvide NULL when missing
Amos Jeffries [Sat, 23 Jul 2011 13:49:47 +0000 (01:49 +1200)] 
Provide NULL when missing

13 years agoPortability polish: use #if instead of #ifdef or #ifndef
Amos Jeffries [Sat, 23 Jul 2011 08:37:52 +0000 (20:37 +1200)] 
Portability polish: use #if instead of #ifdef or #ifndef

... when _SQUID_OS_ macros are involved. Coding guidelines since 3.1 have
been not to. This cleans up all current variations from the guideline.

13 years agoFix GCC4.6 warning unused variables in GnuRegex replacement
Amos Jeffries [Fri, 22 Jul 2011 15:33:47 +0000 (03:33 +1200)] 
Fix GCC4.6 warning unused variables in GnuRegex replacement

13 years agoFix GCC4.6 warning unused variable when --disable-internal-dns
Amos Jeffries [Fri, 22 Jul 2011 14:15:48 +0000 (02:15 +1200)] 
Fix GCC4.6 warning unused variable when --disable-internal-dns

13 years agoRegression fix: vhost and defaultsite causing vport to be ignored
Amos Jeffries [Fri, 22 Jul 2011 13:36:58 +0000 (01:36 +1200)] 
Regression fix: vhost and defaultsite causing vport to be ignored

Instead of dropping it completely we should be sanely combining them like
Squid-2 does for most cases. This appears to have been lost while removing
the getmyHostname() from the process and reducing the
prepareTransparentUrl code.

This fix makes vport apply even if vhost was used. It will modify the
Host: header contents according to the documented vport semantics.

This fix makes vport apply even if defaultsite= was used. It will append
the specified port to the domain name given. Domains with port attached
are not supported and will produce invalid URLs.
TODO: detect this case while parsing the initial config and warn.

13 years agoEnable negative cacheing on unknown or -1 expiry timestamp
Amos Jeffries [Thu, 21 Jul 2011 12:02:28 +0000 (00:02 +1200)] 
Enable negative cacheing on unknown or -1 expiry timestamp

This syncs the squid-3 code with what squid-2 does. THere seem to be no
problems in squid-2, but squid-3 does not cache at times when it should
according to negative_ttl

13 years agoFix GCC 4.6 unused variables in test-suite
Amos Jeffries [Thu, 21 Jul 2011 05:23:16 +0000 (17:23 +1200)] 
Fix GCC 4.6 unused variables in test-suite

13 years agoBug 3273: assertion comm.cc:775: Comm::IsConnOpen(conn)
Christos Tsantilas [Thu, 21 Jul 2011 05:07:42 +0000 (17:07 +1200)] 
Bug 3273: assertion comm.cc:775: Comm::IsConnOpen(conn)

13 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 21 Jul 2011 00:12:33 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoAuthor: Christos Tsantilas <chtsanti@users.sourceforge.net>, Amos Jeffries <squid3...
Christos Tsantilas [Wed, 20 Jul 2011 12:38:39 +0000 (15:38 +0300)] 
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>, Amos Jeffries <squid3@treenet.co.nz>
Bug 3264: Segmentation Fault in src/ipc/Strand.cc(54) receive: 3

The SharedListenResponse because copied using memcpy function (TypedMsgHdr.cc
file, 154 line, Ipc::TypedMsgHdr::getRaw method) can not have complex class
members like the SharedListenResponse::conn which is a RefCounted object.

This patch
 - Remove the SharedListenResponse::conn member and replaced with a
   single SharedListenResponse::fd (integer filedescriptor) member.

 - Does not create a new Comm::Connection object for listening sockets
   inside IPC code , but use the Comm:Connection object created while
   initializing the listening socket and passed to the Ipc::StartListening
   method.

13 years agoBug 3248: login=NEGOTIATE sends wrong auth header to origin peers
Pierre LALET [Wed, 20 Jul 2011 11:01:24 +0000 (23:01 +1200)] 
Bug 3248: login=NEGOTIATE sends wrong auth header to origin peers

13 years agoFix tab indent on ipc/Makefile
Amos Jeffries [Wed, 20 Jul 2011 09:24:15 +0000 (21:24 +1200)] 
Fix tab indent on ipc/Makefile

13 years agoBug 1842: Optimize order of tests in peerWouldBePinged() and peerHTTPOkay()
Jean-Gabriel Dick [Wed, 20 Jul 2011 07:35:53 +0000 (19:35 +1200)] 
Bug 1842: Optimize order of tests in peerWouldBePinged() and peerHTTPOkay()

The peerAllowedToUse() function may be time consuming, especially on sites that
have lots of acls.

13 years agoBug 2051: 'default' cache_peer option does not match documentation
Amos Jeffries [Wed, 20 Jul 2011 07:04:54 +0000 (19:04 +1200)] 
Bug 2051: 'default' cache_peer option does not match documentation

Move the default parent to second-lowest priority on the parent
selection. This also allows the other more delicate balancing
algorithms to work properly with a default configured.

sourcehash and userhash are reversed in priority to simplify the
selection code around #if..#endif once default is moved.

Also, getAnyParent() is dropped. It is redundant with the FIRSTUP
 algorithm.

13 years agoLanguage: de updates
Robert [Tue, 19 Jul 2011 12:01:19 +0000 (00:01 +1200)] 
Language: de updates

13 years agoBug 3280: allow max-size unset and min-size=N to be true for large objects
Amos Jeffries [Mon, 18 Jul 2011 22:43:59 +0000 (10:43 +1200)] 
Bug 3280: allow max-size unset and min-size=N to be true for large objects

13 years agoBug 3267: workers IPC mount points disobey --localstatedir
Amos Jeffries [Mon, 18 Jul 2011 12:04:19 +0000 (00:04 +1200)] 
Bug 3267: workers IPC mount points disobey --localstatedir

13 years agoAcess Control API cleanup
Amos Jeffries [Sat, 16 Jul 2011 15:21:48 +0000 (03:21 +1200)] 
Acess Control API cleanup

In summary:
 * use nonBlockingCheck() or fastCheck() to test ACLs.
 * be prepared to handle any allow_t in the result.

ACL testing functions publicly available from ACLChecklist are:

 - nonBlockingCheck (public), fastCheck public), check (public but not to be used)
 - matchAclListFast (public), matchAclListSlow (private), matchAclList (private).

Given that there are only two types of test performed, this array of API
methods has been causing confusion and mistakes for some developers.

This patch seeks to clarify that API by correcting a flaw in the naming
of check() and matchAclListFast().

Due to "Fast" ACLs coming in two types there are two overloaded
fastCheck() functions. Now with identical output behaviour. Both return
the allow_t result of the lookup. This is expected to _usually_ be
ACCESS_ALLOWED / ACCESS_DENIED but that is not always the case.
Callers need to be written with consideration that the set of enum
results may change.

 - fastCheck(), no parameters, when a full set of "Fast" *_access lines
   are to be scanned. The checklist constructor accepts the list to be
   scanned. This is the old fastCheck(), with the new ALLOWED / DENIED
   / DUNNO result.

 - fastCheck(list), one parameter, when a single-line set of ACLs is to
   be scanned. This is the old matchAclListFast(), with the new ALLOWED
   / DENIED / DUNNO result. Will return ALLOWED whenever the whole set
   of ACLs matches. Other results may vary.

 - nonBlockingCheck() - for "Slow" non-blocking lookups with asynchronous
   callback handler. NP: not touched by this patch.

The output change from boolean to allow_t is due to the fastCheck()
callers mixed set of needs allow/deny/other which boolean cannot meet.
Mapping that tri-state need to a boolean result has led to inconsistent
cases of fastCheck() producing unusual values for "true". Sometimes
wrongly for the caller.

Added result lookup type ACCESS_DUNNO, to indicate a test was unable to
be completed BUT there was no allow/deny/auth-required resulting.

Alters all previous calling code to use the new fastCheck() API output.
Some have been polished up to boolean where appropriate instead of
relying on integer values.

Removes matchAclListFast/matchAclListSlow,
Renames check() to matchNonBlocking;
   all match*() functions are internal operations during ACL testing.

13 years agoAllow MemPool late nitialization
Amos Jeffries [Sat, 16 Jul 2011 04:00:55 +0000 (16:00 +1200)] 
Allow MemPool late nitialization

FQDN had memDataInit() in its component setup, which movedin rev 11499.
The assert is in memCheckInit() and tests that memInit() worked properly.
But if a pool is initialized only when its component is loaded, that
check will fail on several conditions unrelated to the operation of
memory. Seemingly trivial changes to component loading order is one case.

This patch allows modules to initialize/register their own pools on
demand later in the startup process.

* shuffle MEM_DONTFREE which is an existing fixed entry that must not be
  memInitCheck()'d to the end of the MemPool type enum list.

* update memCheckInit() to stop scanning for missing pools at that marker.

* shuffle pool types which are initialized by their components after the
 marker value. Such that no false problem is reported if (a) the
  component is never initialized for that worker, or (b) the component is
  only initialized during the configuration process.

* document this layout significance in the enum list to aid future pool
  additions or moves.

* add asserts to memAllocate() and memFree() to highlight the cases of
  brokenness memCheckInit() was catching. Using assert() instead of if()
  so that optimized builds can avoid the penalty of an extra test on each
  alloc/free.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 16 Jul 2011 00:12:39 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoBug 3246: assertion client_side.cc:1407 connIsUsable(http->getConn())
Christos Tsantilas [Fri, 15 Jul 2011 13:20:26 +0000 (07:20 -0600)] 
Bug 3246: assertion client_side.cc:1407 connIsUsable(http->getConn())

13 years agoBug 3269: cache.log applyQueryParams messages
Amos Jeffries [Fri, 15 Jul 2011 12:52:41 +0000 (00:52 +1200)] 
Bug 3269: cache.log applyQueryParams messages

13 years agoext_kerberos_ldap_group_acl: drop unused variables in SASL support for GCC 4.6
Amos Jeffries [Fri, 15 Jul 2011 05:30:39 +0000 (17:30 +1200)] 
ext_kerberos_ldap_group_acl: drop unused variables in SASL support for GCC 4.6

13 years agoRelease Notes: document CacheManager and eCAP changes
Amos Jeffries [Fri, 15 Jul 2011 03:50:18 +0000 (15:50 +1200)] 
Release Notes: document CacheManager and eCAP changes

13 years agoUse forward-proxy port for internal URLs.
Amos Jeffries [Fri, 15 Jul 2011 03:30:16 +0000 (15:30 +1200)] 
Use forward-proxy port for internal URLs.

Alter the getMyPort() function to skip ports flagged for special mode
handling (intercept, tproxy, accel) when generating internal URLs.

This allows us to lock down security on these special mode ports and
still have an optional position for the forward-proxy port. Prior to
this only the first port was used, forcing an unnecessary configuration
order.

Since it is now possible to have no port available for these URLs the
fatal()/crash has been reduced to an annoying cache.log message. Port 0
will be inserted into the URLs making them invalid.

For now this is only done on http_port entries. https_port has an
incomplete merge of https_port_list/http_port_list which needs to be
completed before it is easily done there.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 15 Jul 2011 00:12:40 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoBug 3274: assertion failed: CommCalls.h:144: "dp"
Christos Tsantilas [Thu, 14 Jul 2011 09:09:25 +0000 (12:09 +0300)] 
Bug 3274: assertion failed: CommCalls.h:144: "dp"

The  ConnOpener::earlyAbort method shopuld defined as comm close handler
which means that it should have as argument CommCloseCbParams not
CommConnectCbParams

13 years agoPort 2.7: act-as-origin for reverse proxy ports
Amos Jeffries [Thu, 14 Jul 2011 08:59:10 +0000 (02:59 -0600)] 
Port 2.7: act-as-origin for reverse proxy ports

13 years agoAuthor: Amos Jeffries <squid3@treenet.co.nz>, Christos Tsantilas <chtsanti@users...
Christos Tsantilas [Tue, 12 Jul 2011 19:02:48 +0000 (22:02 +0300)] 
Author: Amos Jeffries <squid3@treenet.co.nz>, Christos Tsantilas <chtsanti@users.sourceforge.net>
Add DNS lookup step to ICAP connect

This patch add an async DNS lookup step to the ICAP connection setup process.
As a side effect it adds a little bit of tcp_outgoing_address support to ICAP.
Its limited to "dst" ACL at present. So outgoing ACL selections depending on
HTTP request details wont work. Which makes sense since this connection may
be reused for multiple requests.

More than one IP result are not used  since there seems to be no sane place
to store multiple IPs between connect attempts. It currently relies on ipcache
MarkGood/MarkBad keeping a good usable IP at the top of the IP set.

This patch also try to make Max-Connections ICAP feature cooperate well with
the new DNS lookup code

13 years agoBug 3195: kerberos_ldap_group will not build without kerberos
Markus Moeller [Tue, 12 Jul 2011 05:54:58 +0000 (23:54 -0600)] 
Bug 3195: kerberos_ldap_group will not build without kerberos

cleans up include file which does not require any gssapi headers and
checks for kerberos availability.

13 years agoRemove redundant config.h includes
Amos Jeffries [Tue, 12 Jul 2011 05:52:07 +0000 (23:52 -0600)] 
Remove redundant config.h includes

13 years agokerberos_lap_group: several fixes
Markus Moeller [Tue, 12 Jul 2011 05:47:25 +0000 (23:47 -0600)] 
kerberos_lap_group: several fixes

* detect SASL2 libraries on 64-bit RPM and BSD systems
* parse for -S command line option properly
* debug and process NULL domains better

13 years agoAdd more debugging to tunnel.cc
Amos Jeffries [Mon, 11 Jul 2011 08:28:29 +0000 (02:28 -0600)] 
Add more debugging to tunnel.cc

No logic changes. just cache.log output display for some more events.

13 years agoBug 2495: ignore whitespace prefix on config lines
Amos Jeffries [Sun, 10 Jul 2011 21:42:02 +0000 (09:42 +1200)] 
Bug 2495: ignore whitespace prefix on config lines

Allow whitespace indentation before any lines. Making SMP and comment
configuration easier to read for some.

14 years agoPermit simple HTTP version debug logging
Amos Jeffries [Fri, 8 Jul 2011 06:01:48 +0000 (00:01 -0600)] 
Permit simple HTTP version debug logging

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

14 years agoBug fixes: Multiple bugs in IdleConnList part3
Christos Tsantilas [Thu, 7 Jul 2011 19:08:17 +0000 (22:08 +0300)] 
Bug fixes: Multiple bugs in IdleConnList part3

- fix the IdleConnList::closeN to correctly close N connection objects

PS. what an exercise!

14 years agoBug 3222: cache_peer name is not logging on CONNECT
Amos Jeffries [Thu, 7 Jul 2011 11:48:08 +0000 (23:48 +1200)] 
Bug 3222: cache_peer name is not logging on CONNECT

14 years agoBug fixes: Multiple bugs in IdleConnList part2
Christos Tsantilas [Thu, 7 Jul 2011 10:13:53 +0000 (13:13 +0300)] 
Bug fixes: Multiple bugs in IdleConnList part2

commit revno:11534  fixes:
 - Inside IdleConnList::removeAt method the ellements deleted correctly from
   the theList_ array. The problem was that if parent_ exist the size of the
   array is not decreased and the last element was duplicated (the last two
   ellements pointed to the same connection object).
   The commit revno:11534 did not solve this problem and just created a
   duplicate entry in an other position.
   This patch solves the problems in IdleConnList::removeAt method.

Other:
 - Remove the fd_table[fd].flags.read_pending tests inside IdleConnList::pop
   and IdleConnList::findUsable methods. This flag currently is not fully
   implemented and used only by the ssl stuff.

 - Inside IdleConnList::closeN method in two positions we are storing the
   reference of the Comm::Connection object which will be deleted, to use it
   to clean up and close the connection later:
       const Comm::ConnectionPointer &conn = theList_[--size_];
       theList_[size_] = NULL;
   This is wrong because the second command may delete the conn object, causing
   assertion in Comm::Connection destructor, because it is still open, or
   segmentation faults when trying to use the conn object later.
   This patch replaces the pointer reference with a normal pointer.

 - Call clearHandlers inside IdleConnList::pop and IdleConnList::findUsable
   methods before return the Comm::Connection object to the user.

14 years agoLanguage: fr updates
Bernard [Thu, 7 Jul 2011 00:01:44 +0000 (12:01 +1200)] 
Language: fr updates

14 years agoprep for 3.1.14
Amos Jeffries [Mon, 4 Jul 2011 04:34:37 +0000 (22:34 -0600)] 
prep for 3.1.14

14 years agoBug 3261: Could not create a DNS socket
Amos Jeffries [Mon, 4 Jul 2011 04:28:59 +0000 (22:28 -0600)] 
Bug 3261: Could not create a DNS socket

Reverts bzr revision 11530 due to regression.

14 years agoOptimization: Swap default manager ACL order
Amos Jeffries [Mon, 4 Jul 2011 02:41:42 +0000 (20:41 -0600)] 
Optimization: Swap default manager ACL order

14 years agoBug 2862: add http(s):// support to cache manager
Amos Jeffries [Mon, 4 Jul 2011 01:48:32 +0000 (13:48 +1200)] 
Bug 2862: add http(s):// support to cache manager

via http://$visible_hostname/ requests intercepted by the internal
server feature. Also https:// if SSL/TLS is available on the receiving
port.

In order to safely identify the manager reports the path prefix
/squid-internal-mgr/ is added. The old cache_oject:// scheme format
paths follow that identifier prefix.

To retrieve pages the proxy visible_hostname, management port (first
forward-proxy port), and the path prefix must all be present in the URL.

The "manager" ACL is altered to url_regex in order to match the new
protocol+path URL syntax.

Unlike the cache_object:// scheme, http[s]:// do not accept password
as part of the URL. If one is needed it must be sent via the HTTP
Authorization: Basic authentication header.

NP: use of this per-action cachemgr_passwd is not secure and should be
avoided. Stronger security can be gained via http_access with regular
proxy_auth and other ACLs.

14 years agoRemove duplicate calls to IsAnyAddr in DNS
Amos Jeffries [Mon, 4 Jul 2011 01:25:42 +0000 (13:25 +1200)] 
Remove duplicate calls to IsAnyAddr in DNS

14 years agoBug fixes: Multiple bugs in IdleConnList
Christos Tsantilas [Fri, 1 Jul 2011 19:30:23 +0000 (22:30 +0300)] 
Bug fixes: Multiple bugs in IdleConnList

- Inside IdleConnList::removeAt method the last element of the
  IdleConnList::theList_ array initialized with random memory
- Inside IdleConnList::removeAt method if the IdleConnList::parent_ is NULL
  (ICAP connections pools) the size_ of the array is not decreased after
  element removed
- Inside IdleConnList::closeN method, it removes always all elements from the
  list except the first one

14 years agoPrep for 3.1.13
Amos Jeffries [Fri, 1 Jul 2011 02:28:38 +0000 (14:28 +1200)] 
Prep for 3.1.13

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

14 years agoRemove the HttpStateData::orig_request member
Christos Tsantilas [Thu, 30 Jun 2011 08:33:36 +0000 (11:33 +0300)] 
Remove the HttpStateData::orig_request member

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.

This special HttpRequest sets the proper urlpath (which maybe different from
the original HttpRequest), the host (HttpRequest::SetHost/GetHost) to be the
peer hostname and inherits flags, protocol, method. Also sets the
HttpRequest::flags.proxying.

Probably this is originaly done to handle only the differences in urlpath and
the host. But this is has  as result to have two HttpRequests object in
HttpStateData, but their difference is not clear.

This patch removes the HttpStateData::orig_request member and uses only the
HttpStateData::request member

Bugs fixed with this patch:

- Debugs() and error pages sometimes display the cache_peer hostname as the URL   requested domain name when going to an origin. Regardless of what the virtual
  host name actually is.

- The request_header_access configuration parameter does not work when
  sending requests to parent proxies.

- Squid may cache replies to requests with no-store in headers when uses a
  parent cache.

- parent caches which have been configured as "sibling" for specific domains
  using the neighbor_type_domain parameter are not counted.

- Probably many other

This is a Measurement Factory project

14 years agoIp::Address::IsAnyAddr did not return true in the case the ip address is an ipv4...
Christos Tsantilas [Wed, 29 Jun 2011 19:58:09 +0000 (22:58 +0300)] 
Ip::Address::IsAnyAddr did not return true in the case the ip address is an ipv4 anyaddr

14 years agoDrop duplicate code on FTP data accept
Amos Jeffries [Tue, 28 Jun 2011 01:39:23 +0000 (13:39 +1200)] 
Drop duplicate code on FTP data accept