]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
13 years agoConverts the bulk of cf_gen to C++ OOP code.
Amos Jeffries [Fri, 19 Aug 2011 03:35:19 +0000 (21:35 -0600)] 
Converts the bulk of cf_gen to C++ OOP code.

* char* tree members to std::string. Which eliminates xstrdup() and
  xis*() calls.

* structs to classes and replaces calloc/free with new/delete.

* link cf_gen_depends.cci directly to autoconf.h defines.

The result of these is that we can erase the dependencies on util.h,
time.cc, config.h, libcompat.la, libmisc.la and other libraries.
Directly fixing seevral build and cross-compile issues that keep appearing
on various OS.

TODO:
 There is a bit further cleanup we can do. Replacing several classes with
 std::list<std::string>.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 17 Aug 2011 00:14:46 +0000 (18:14 -0600)] 
SourceFormat Enforcement

13 years agoCompile fix: use code instead of static initialization
Francesco Chemolli [Tue, 16 Aug 2011 21:42:05 +0000 (23:42 +0200)] 
Compile fix: use code instead of static initialization

g++ 4.4.5 on ARM mis-detects an inizializer's variable size. Give it a hint.

13 years agoAdd special case for CONNECT request Host: verify
Amos Jeffries [Tue, 16 Aug 2011 08:13:38 +0000 (20:13 +1200)] 
Add special case for CONNECT request Host: verify

13 years agoPolish: warn on every ssl-bump disable, with port details
Amos Jeffries [Tue, 16 Aug 2011 00:01:21 +0000 (18:01 -0600)] 
Polish: warn on every ssl-bump disable, with port details

13 years agoAudit updates on rev.11634
Alex Rousskov [Mon, 15 Aug 2011 22:21:03 +0000 (16:21 -0600)] 
Audit updates on rev.11634

13 years agoRework CVE-2009-0801 case set
Amos Jeffries [Mon, 15 Aug 2011 12:47:58 +0000 (00:47 +1200)] 
Rework CVE-2009-0801 case set

 * Correct results when Host: and URL both contain an unusual port.
 * Catch additional cases where implicit default port is made explicit

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

13 years agoImprove CVE-2009-0801 detection warning
Amos Jeffries [Sun, 14 Aug 2011 23:34:26 +0000 (11:34 +1200)] 
Improve CVE-2009-0801 detection warning

13 years agoFix NIS helper build on FreeBSD
Pawel Worach [Sun, 14 Aug 2011 12:42:59 +0000 (00:42 +1200)] 
Fix NIS helper build on FreeBSD

Fails on clang++ and other strict compilers due to missing __cplusplus
checks in FreeBSD system headers and yp_prot.h typedefs bool unless
BOOL_DEFINED is defined.

13 years agoConvert AuthenticateAcl() to use new ACL states
Amos Jeffries [Sun, 14 Aug 2011 12:18:57 +0000 (06:18 -0600)] 
Convert AuthenticateAcl() to use new ACL states

13 years agoConvert external ACL to use ACL states
Amos Jeffries [Sun, 14 Aug 2011 11:40:33 +0000 (05:40 -0600)] 
Convert external ACL to use ACL states

13 years agoUpdate response generationg to handle auth ACL reply cases
Amos Jeffries [Sun, 14 Aug 2011 10:47:37 +0000 (04:47 -0600)] 
Update response generationg to handle auth ACL reply cases

Known + expired + OK credentials do not need a re-challenge. They are in
grace period where helper revalidation is all that is needed.

Any other result requires an error or challenge response of some sort.

13 years agoBug 1791: timestampsSet does not validate Date: if server sends very old date
Barry Dobyns [Sun, 14 Aug 2011 03:48:26 +0000 (21:48 -0600)] 
Bug 1791: timestampsSet does not validate Date: if server sends very old date

13 years agoBug 3211: ssl_crtd start even if no ssl-bump port is configured
Christos Tsantilas [Sun, 14 Aug 2011 03:28:48 +0000 (21:28 -0600)] 
Bug 3211: ssl_crtd start even if no ssl-bump port is configured

13 years agoBug 3289: cache manager parameters not parsed without password
Amos Jeffries [Sun, 14 Aug 2011 03:20:59 +0000 (15:20 +1200)] 
Bug 3289: cache manager parameters not parsed without password

13 years agoSupport extended authentication states to ACL results
Amos Jeffries [Sat, 13 Aug 2011 15:53:38 +0000 (09:53 -0600)] 
Support extended authentication states to ACL results

Support sub-states of authentication to be sent as results from ACLs.
This allows future work to resolve issues around cases such as expired
but known credentials being used in fast category access controls.

The new authentication states are:
  ACCESS_AUTH_OK
    - equivalent to ACCESS_ALLOWED

  ACCESS_AUTH_REQUIRED
    - Missing Credentials. Used to be ACCESS_REQ_PROXY_AUTH

  ACCESS_AUTH_EXPIRED_OK
    - Expired now. Were Okay.

  ACCESS_AUTH_EXPIRED_BAD
    - Expired now. Were Failed.

Also converts cases of ACCESS_REQ_PROXY_AUTH to the new name.

As yet no attempt is made to alter auth or access control logics to use
the new states.

13 years agoFix signed/unsigend conversion error
Amos Jeffries [Sat, 13 Aug 2011 14:55:47 +0000 (02:55 +1200)] 
Fix signed/unsigend conversion error

13 years agoFix GCC 4.6 unused variable in regex
Amos Jeffries [Sat, 13 Aug 2011 14:49:59 +0000 (02:49 +1200)] 
Fix GCC 4.6 unused variable in regex

13 years agoTypo in cf_gen
Pawel Worach [Sat, 13 Aug 2011 07:00:23 +0000 (19:00 +1200)] 
Typo in cf_gen

13 years agoBug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable
Alex Rousskov [Sat, 13 Aug 2011 04:15:06 +0000 (22:15 -0600)] 
Bug 3217: "!fd_table[fd].closing()" from ServerStateData::noteMoreBodySpaceAvailable

It is possible that the next hop connection is going through the closing steps
when we receive a "noteMoreBodySpaceAvailable" notification from the response
body consumer. Do not try to read in this case.

13 years agoFix compile errors detected by clang++
Pawel Worach [Fri, 12 Aug 2011 04:32:14 +0000 (22:32 -0600)] 
Fix compile errors detected by clang++

13 years agoPortability: cf_gen stream errors on FreeBSD
Amos Jeffries [Wed, 10 Aug 2011 14:39:48 +0000 (08:39 -0600)] 
Portability: cf_gen stream errors on FreeBSD

13 years agoBug 3107: nsca_auth DES silently truncates passwords to 8 bytes
Amos Jeffries [Wed, 10 Aug 2011 00:23:14 +0000 (18:23 -0600)] 
Bug 3107: nsca_auth DES silently truncates passwords to 8 bytes

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

13 years agoregex optimization: const-correctness
Amos Jeffries [Tue, 9 Aug 2011 14:01:18 +0000 (02:01 +1200)] 
regex optimization: const-correctness

13 years agocf_gen.cc: work around brokenness in Intel's compiler wrt 64-bit fstreams
Francesco Chemolli [Tue, 9 Aug 2011 10:04:54 +0000 (12:04 +0200)] 
cf_gen.cc: work around brokenness in Intel's compiler wrt 64-bit fstreams

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

14 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.

14 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.

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

14 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())

14 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

14 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

14 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