]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 years agoMacOS: fix AddrInfo default flags
Amos Jeffries [Sat, 11 Aug 2012 03:21:14 +0000 (21:21 -0600)] 
MacOS: fix AddrInfo default flags

12 years agoshuffel MEMPROXY macros for better CacheMgr reporting names
Amos Jeffries [Sat, 11 Aug 2012 02:04:03 +0000 (20:04 -0600)] 
shuffel MEMPROXY macros for better CacheMgr reporting names

12 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 11 Aug 2012 00:14:47 +0000 (18:14 -0600)] 
SourceFormat Enforcement

12 years agoallow for _SQUID_EXTERNNEW_ predefine
Amos Jeffries [Fri, 10 Aug 2012 08:09:43 +0000 (02:09 -0600)] 
allow for _SQUID_EXTERNNEW_ predefine

12 years agoSourceLayout: introduce Fs::Ufs namespace, split ufscommon, store_dir_ufs and store_i...
Francesco Chemolli [Fri, 10 Aug 2012 06:56:49 +0000 (08:56 +0200)] 
SourceLayout: introduce Fs::Ufs namespace, split ufscommon, store_dir_ufs and store_io_ufs

12 years agoRelease Notes: updates after STRICT_ORIGINAL_DST changes
Amos Jeffries [Fri, 10 Aug 2012 05:56:58 +0000 (23:56 -0600)] 
Release Notes: updates after STRICT_ORIGINAL_DST changes

12 years agoBug 3478: workaround: better default handling without -DSTRICT_ORIGINAL_DST
Amos Jeffries [Fri, 10 Aug 2012 02:41:14 +0000 (14:41 +1200)] 
Bug 3478: workaround: better default handling without -DSTRICT_ORIGINAL_DST

This extends the -DSTRICT_ORIGINAL_DST compile-time flag to include the
logics listing ORIGINAL_DST as first preferred destination.

Which makes ORIGINAL_DST a swap-in replacement for DIRECT and enables
never_direct, always_direct, prefer_direct configuration to apply.

12 years agoMacOS: warning: 'gnu_inline' attribute directive ignored
Amos Jeffries [Fri, 10 Aug 2012 01:12:48 +0000 (13:12 +1200)] 
MacOS: warning: 'gnu_inline' attribute directive ignored

12 years agoMacOS: detect glibtool and glibtoolize when bootstrapping
Amos Jeffries [Fri, 10 Aug 2012 00:38:14 +0000 (12:38 +1200)] 
MacOS: detect glibtool and glibtoolize when bootstrapping

12 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 10 Aug 2012 00:12:23 +0000 (18:12 -0600)] 
SourceFormat Enforcement

12 years agoConvert all yet-unconverted stub files to the STUB API.
Francesco Chemolli [Thu, 9 Aug 2012 15:01:02 +0000 (17:01 +0200)] 
Convert all yet-unconverted stub files to the STUB API.

12 years agoMerged from trunk
Francesco Chemolli [Thu, 9 Aug 2012 14:59:30 +0000 (16:59 +0200)] 
Merged from trunk

12 years agoFix missing include for leakcheck.h
Amos Jeffries [Thu, 9 Aug 2012 10:38:38 +0000 (22:38 +1200)] 
Fix missing include for leakcheck.h

12 years agoPortability: shuffle out the last useful macros from squid-old.h
Amos Jeffries [Thu, 9 Aug 2012 10:32:57 +0000 (22:32 +1200)] 
Portability: shuffle out the last useful macros from squid-old.h

12 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 9 Aug 2012 00:12:47 +0000 (18:12 -0600)] 
SourceFormat Enforcement

12 years agoimplemented STUB_RETVAL_NOP
Francesco Chemolli [Wed, 8 Aug 2012 12:14:34 +0000 (14:14 +0200)] 
implemented STUB_RETVAL_NOP
Converted stub_tools to stup API.

12 years agoconverted stub_StatHist.cc stub_main_cc.cc stub_mem.cc stub_store_rebuild.cc to stub API
Francesco Chemolli [Wed, 8 Aug 2012 09:24:40 +0000 (11:24 +0200)] 
converted stub_StatHist.cc stub_main_cc.cc stub_mem.cc stub_store_rebuild.cc to stub API

12 years agoPortability: CMSG_*() macro API substitute
Amos Jeffries [Wed, 8 Aug 2012 08:15:28 +0000 (02:15 -0600)] 
Portability: CMSG_*() macro API substitute

12 years agoWindows: MinGW provides truncate()/ftruncate()
Amos Jeffries [Wed, 8 Aug 2012 08:01:46 +0000 (20:01 +1200)] 
Windows: MinGW provides truncate()/ftruncate()

12 years agoFixed formatting of stub_libcomm.cc
Francesco Chemolli [Wed, 8 Aug 2012 07:54:29 +0000 (09:54 +0200)] 
Fixed formatting of stub_libcomm.cc

12 years agoWindows: fix winsock detection capabilities
Francesco Chemolli [Wed, 8 Aug 2012 07:39:35 +0000 (01:39 -0600)] 
Windows: fix winsock detection capabilities

12 years agoMoved to STUB API stubs for DelayId.cc, HelperChildconfig.cc, debug.cc
Francesco Chemolli [Wed, 8 Aug 2012 07:35:10 +0000 (09:35 +0200)] 
Moved to STUB API stubs for DelayId.cc, HelperChildconfig.cc, debug.cc

12 years agoWindows: provide POSIX ABI wrapper for mkdir()
Amos Jeffries [Wed, 8 Aug 2012 07:21:13 +0000 (19:21 +1200)] 
Windows: provide POSIX ABI wrapper for mkdir()

12 years agoMerged from trunk
Francesco Chemolli [Tue, 7 Aug 2012 15:58:34 +0000 (17:58 +0200)] 
Merged from trunk

12 years agoRemoved dead code from stub_cache_cf.cc and stub_client_side_request.cc
Francesco Chemolli [Tue, 7 Aug 2012 15:58:08 +0000 (17:58 +0200)] 
Removed dead code from stub_cache_cf.cc and stub_client_side_request.cc

12 years agoMoved CBDATA_CLASS declarations to the end of classes as per coding guidelines.
Francesco Chemolli [Tue, 7 Aug 2012 15:12:08 +0000 (17:12 +0200)] 
Moved CBDATA_CLASS declarations to the end of classes as per coding guidelines.

12 years agoChanged all level-0 debugs messages to use the DBG_CRITICAL definition.
Francesco Chemolli [Mon, 6 Aug 2012 17:41:08 +0000 (19:41 +0200)] 
Changed all level-0 debugs messages to use the DBG_CRITICAL definition.

12 years agoChanged all level-1 debugs messages to use DBG_IMPORTANT definition.
Francesco Chemolli [Mon, 6 Aug 2012 17:21:57 +0000 (19:21 +0200)] 
Changed all level-1 debugs messages to use DBG_IMPORTANT definition.

12 years agoImprove support for clang compilers
Francesco Chemolli [Mon, 6 Aug 2012 15:38:12 +0000 (17:38 +0200)] 
Improve support for clang compilers

clang++ doesn't support c++ variable arrays for non-pod types.
Change variable arrays to dynamically-allocated arrays, Ipc::QueueReaders, Ipc::StoreMap and Ipc::Mem::PageStack

12 years agoRelease notes: use SPONSORS (no file type) as the published file name
Amos Jeffries [Sun, 5 Aug 2012 11:11:02 +0000 (23:11 +1200)] 
Release notes: use SPONSORS (no file type) as the published file name

SPONSORS.txt is the website published filename, but it seems some distros
were using the source code file name.

Use SPONSORS.ist for the coded listings instead.

13 years agoRelease Notes: NCSA helper algorithm limits
Amos Jeffries [Thu, 2 Aug 2012 12:03:50 +0000 (06:03 -0600)] 
Release Notes: NCSA helper algorithm limits

13 years agoPrep for 3.2.0.19
Amos Jeffries [Thu, 2 Aug 2012 11:55:39 +0000 (05:55 -0600)] 
Prep for 3.2.0.19

13 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 2 Aug 2012 00:12:45 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoStub updates after bump-server-first changes
Amos Jeffries [Wed, 1 Aug 2012 23:52:59 +0000 (11:52 +1200)] 
Stub updates after bump-server-first changes

13 years agoMore GCC 4.2 dependency fixes
Amos Jeffries [Wed, 1 Aug 2012 12:51:45 +0000 (00:51 +1200)] 
More GCC 4.2 dependency fixes

13 years agoRelease notes: build SPONSORS.txt in bootstrap instead of automake
Amos Jeffries [Wed, 1 Aug 2012 12:37:25 +0000 (00:37 +1200)] 
Release notes: build SPONSORS.txt in bootstrap instead of automake

13 years agoRevert r12231 - seems to break SMP cache
Amos Jeffries [Wed, 1 Aug 2012 11:54:23 +0000 (23:54 +1200)] 
Revert r12231 - seems to break SMP cache

13 years agoSkip Failure Ratio calculations entirely when ICP is disabled.
Amos Jeffries [Wed, 1 Aug 2012 07:55:18 +0000 (19:55 +1200)] 
Skip Failure Ratio calculations entirely when ICP is disabled.

Also, mention ICP in the logged error message. unqualified 'HIT' confuses
people (self included) more familiar with the HTTP type of HIT responses.

13 years agoSupport -DFAILURE_MODE_TIME=n compiler flag
Amos Jeffries [Wed, 1 Aug 2012 07:01:58 +0000 (19:01 +1200)] 
Support -DFAILURE_MODE_TIME=n compiler flag

This value determins at compile-time how long Squid spends in HIT-only
mode after the failure ratio goes over 1.0. see checkFailureRatio() in
src/client_side_request.cc for details on the ratio.

This flag is supported to remove the need for patching when alteration
is required.

13 years agoAdd copyright attributions for SN.png and errorpage.css
Amos Jeffries [Wed, 1 Aug 2012 06:40:26 +0000 (18:40 +1200)] 
Add copyright attributions for SN.png and errorpage.css

13 years agoRemoved some duplicates and fixed formatting in CONTRIBUTORS list
Francesco Chemolli [Tue, 31 Jul 2012 09:51:38 +0000 (11:51 +0200)] 
Removed some duplicates and fixed formatting in CONTRIBUTORS list

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 31 Jul 2012 00:13:24 +0000 (18:13 -0600)] 
SourceFormat Enforcement

13 years agoRelease notes: typo
Amos Jeffries [Mon, 30 Jul 2012 09:58:32 +0000 (03:58 -0600)] 
Release notes: typo

13 years agoGCC 4.2 dependencies
Amos Jeffries [Mon, 30 Jul 2012 08:49:59 +0000 (02:49 -0600)] 
GCC 4.2 dependencies

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

13 years agoBug 3478: Allow peer selection
Amos Jeffries [Sun, 29 Jul 2012 08:15:17 +0000 (02:15 -0600)] 
Bug 3478: Allow peer selection

This re-enables Squid peer selection algorithms for intercepted
traffic which has failed Host header verification.

When host verification fails Squid will use, in order of preference:
 * an already PINNED server connection
 * the client ORIGINAL_DST details
 * cache_peer as chosen by selection algorithms

NOTE: whenever DIRECT is selected by routing algorithms the
      ORIGINAL_DST is used instead.

Peer selection results are updated to display PINNED and
ORIGINAL_DST alongside DIRECT and cache_peer.

SECURITY NOTE:

  At this point Squid will pass the request to cache_peer using the
  non-trusted Host header in their URLs. Meaning that the peers
  may still be poisoned by CVE-2009-0801 attacks. Only the initial
  intercepting proxy is protected.

  Full protection against CVE-2009-0801 can be enjoyed by building
  Squid with the -DSTRICT_HOST_VERIFY compile-time flag. This will
  make the peers unreachable for intercepted traffic where the
  Host verification has failed.

13 years agoBug 3580: IDENT request makes squid crash
Amos Jeffries [Sun, 29 Jul 2012 06:10:44 +0000 (18:10 +1200)] 
Bug 3580: IDENT request makes squid crash

13 years agoRelease Notes: update SPONSORS list
Amos Jeffries [Sun, 29 Jul 2012 04:33:44 +0000 (22:33 -0600)] 
Release Notes: update SPONSORS list

The SPONSORS file is supposed to:

* list Sponsors who paid for significant developments in the squid code,
  donated hardware for devleopment etc.
* exclude cash donations to the project (only cash to a developer for
  specific work)
* in an ordered list broken down in reverse-chronological order of the
  latest release they sponsored anything.

For simplicity of maintenance I'm adding @Squid-X.Y labels at the
boundaries for the bzr copy. They should be stripped out automatically
by the "make dist" process for release packaging.

13 years agoRelease Notes: update CONTRIBUTORS to match patch authors list
Amos Jeffries [Sat, 28 Jul 2012 06:02:45 +0000 (00:02 -0600)] 
Release Notes: update CONTRIBUTORS to match patch authors list

13 years agoAdjust for GCC-4.7
Henrik Nordstrom [Fri, 27 Jul 2012 23:02:09 +0000 (01:02 +0200)] 
Adjust for GCC-4.7

13 years agoMerged Postfix-Prefix branch: Fix decrement operator in hash4 function(lib/hash.c)
Christos Tsantilas [Thu, 26 Jul 2012 17:36:58 +0000 (20:36 +0300)] 
Merged Postfix-Prefix branch: Fix decrement operator in hash4 function(lib/hash.c)

The "Postfix-Prefix" patch code is not equivalent with the replaced code inside
hash4 function.

13 years agoConsolidate external_acl_form config dumping a bit and add missing percent dumper.
Robert Collins [Thu, 26 Jul 2012 08:40:22 +0000 (20:40 +1200)] 
Consolidate external_acl_form config dumping a bit and add missing percent dumper.

13 years agoAllow a ufs cache_dir entry to coexist with a shared memory cache entry
Alex Rousskov [Wed, 25 Jul 2012 23:57:51 +0000 (17:57 -0600)] 
Allow a ufs cache_dir entry to coexist with a shared memory cache entry
instead of being released when it becomes idle.

The original boolean version of the StoreController::dereference() code
(r11730) was written to make sure that idle unlocked local store_table entries
are released if nobody needs them (to avoid creating inconsistencies with
shared caches that could be modified in a different process).

Then, in r11786, we realized that the original code was destroying non-shared
memory cache entries if there were no cache_dirs to vote for keeping them in
store_table. I fixed that by changing the StoreController::dereference() logic
from "remove if nobody needs it" to "remove if somebody objects to keeping
it". That solved the problem at hand, but prohibited an entry to exist in
a non-shared cache_dir and in a shared memory cache at the same time.

We now go back to the original "remove if nobody needs it" design but also
give non-shared memory cache a vote so that it can protect idle non-shared
memory cached entries from being released if there are no cache_dirs to vote
for them.

13 years agoBug 3593: socket failure: Address family not supported by protocol
Amos Jeffries [Wed, 25 Jul 2012 22:29:21 +0000 (10:29 +1200)] 
Bug 3593: socket failure: Address family not supported by protocol

13 years agoRemove unnecessary todo marker in stub_debug.cc
Francesco Chemolli [Wed, 25 Jul 2012 12:31:05 +0000 (14:31 +0200)] 
Remove unnecessary todo marker in stub_debug.cc

13 years agoMerged Postfix-Prefix branch: refactor inc/decrement operators from postfix to prefix...
Francesco Chemolli [Tue, 24 Jul 2012 08:59:54 +0000 (10:59 +0200)] 
Merged Postfix-Prefix branch: refactor inc/decrement operators from postfix to prefix form.

13 years agoChanged some increment/decrement operators from postfix to prefix form.
Francesco Chemolli [Mon, 23 Jul 2012 19:37:47 +0000 (21:37 +0200)] 
Changed some increment/decrement operators from postfix to prefix form.

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Mon, 23 Jul 2012 15:34:12 +0000 (17:34 +0200)] 
Changed increment operators from postfix to prefix form.

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Mon, 23 Jul 2012 15:15:27 +0000 (17:15 +0200)] 
Changed increment operators from postfix to prefix form.

13 years agoMerged from trunk
Francesco Chemolli [Mon, 23 Jul 2012 07:02:06 +0000 (09:02 +0200)] 
Merged from trunk

13 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 23 Jul 2012 00:12:14 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoStop HttpRequest and AccessLogEntry memory leaks.
Alex Rousskov [Sun, 22 Jul 2012 03:15:02 +0000 (21:15 -0600)] 
Stop HttpRequest and AccessLogEntry memory leaks.

The leaks were introduced by recent request_header_add improvements (r12213)
which needed server-side access to client-side information like client
certificate so that it can be stuffed into the outgoing request headers.
Stuffing was done via Format API that uses AccessLogEntry as the source of
information.

This change breaks the HttpRequest->AccessLogEntry->HttpRequest refcounting
loop that prevented both request and ale objects from being destroyed. The ale
object is now delivered to the server side using FwdState::Start() API.  Only
HTTP code currently takes advantage of ale availability on the server side.

Also had to modify httpHdrAdd() API because ale is no longer available via
the request pointer.

13 years agoAdded missing cbdata debugging so that find-alive.pl can find cbdata leaks.
Alex Rousskov [Fri, 20 Jul 2012 23:25:57 +0000 (17:25 -0600)] 
Added missing cbdata debugging so that find-alive.pl can find cbdata leaks.

13 years agoAdded a todo to avoid a pointless validation loop when validation (-S) is not
Alex Rousskov [Fri, 20 Jul 2012 23:17:53 +0000 (17:17 -0600)] 
Added a todo to avoid a pointless validation loop when validation (-S) is not
requested.

13 years agoAvoid bogus "Disk space over limit" warnings when rebuidling dirty ufs index.
Alex Rousskov [Fri, 20 Jul 2012 23:11:02 +0000 (17:11 -0600)] 
Avoid bogus "Disk space over limit" warnings when rebuidling dirty ufs index.

Subtract sizes of added-then-rejected entries while loading ufs cache index.

Before SMP changes, the ufs code was incorrectly ignoring the size of
loaded-but-not-yet-validated entries, leading to cache disk overflows.
After SMP changes, the ufs code was not subtracting sizes of
loaded-but-then-rejected entries, leading to bogus "Disk space over
limit" warnings. Now we correctly account for both kinds of entries.

13 years agoChanged decrement operators from postfix to prefix form.
Francesco Chemolli [Fri, 20 Jul 2012 15:31:04 +0000 (17:31 +0200)] 
Changed decrement operators from postfix to prefix form.

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Fri, 20 Jul 2012 12:44:39 +0000 (14:44 +0200)] 
Changed increment operators from postfix to prefix form.

13 years agoSilence IOS 15.1 unknown capabilities messages.
Amos Jeffries [Fri, 20 Jul 2012 11:37:43 +0000 (05:37 -0600)] 
Silence IOS 15.1 unknown capabilities messages.

Its nice to know when new capabilities are added.
But we don't need to report after being informed about them.

TODO: reduce the message to once every thousand or so.
  But be careful to identify what different type numbers exist.

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Thu, 19 Jul 2012 13:49:54 +0000 (15:49 +0200)] 
Changed increment operators from postfix to prefix form.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 19 Jul 2012 00:12:22 +0000 (18:12 -0600)] 
SourceFormat Enforcement

13 years agoSslBump: Support bump-ssl-server-first / fix build errors
Christos Tsantilas [Wed, 18 Jul 2012 20:20:34 +0000 (23:20 +0300)] 
SslBump: Support bump-ssl-server-first / fix build errors

Wrap inside "#if USE_AUTH .. #endif" block authentication related code to
allow build when no authentication used in squid

13 years agoauthor: Alex Rousskov <rousskov@measurement-factory.com>, Christos Tsantilas <chtsant...
Christos Tsantilas [Wed, 18 Jul 2012 17:45:54 +0000 (20:45 +0300)] 
author: Alex Rousskov <rousskov@measurement-factory.com>, Christos Tsantilas <chtsanti@users.sourceforge.net>
SslBump: Support bump-ssl-server-first and mimic SSL server certificates.

Summary: These changes allow Squid working in SslBump mode to peek at
the origin server certificate and mimic peeked server certificate
properties in the generated fake certificate, all prior to establishing
a secure connection with the client:
http://wiki.squid-cache.org/Features/BumpSslServerFirst
http://wiki.squid-cache.org/Features/MimicSslServerCert

The changes are required to bump intercepted SSL connections without
excessive browser warnings. The changes allow to disable bumping of some
intercepted SSL connections, forcing Squid to go into a TCP tunnel mode
for those connections.

The changes also empower end user to examine and either honor or bypass
most origin SSL server certificate errors. Prior to these changes, the
responsibility for ignoring certificate validation errors belonged
exclusively to Squid, necessarily leaving users in the dark if errors
are ignored/bypassed.

Squid can still be configured to emulate old bump-ssl-client-first
behavior.  However, a manual revision of ssl_bump options is required
during upgrade because ssl_bump no longer supports an implicit "negate
the last one" rule (and it is risky to let Squid guess what the admin
true intent was or mix old- and new-style rules).

Finally, fake certificate generation has been significantly improved.
The new code guarantees that all identically configured Squids receiving
identical origin server certificates will generate identical fake
certificates, even if those Squid instances are running on different
hosts, at different times, and do not communicate with each other. Such
stable, reproducible certificates are required for distributed,
scalable, or fail-safe Squid deployment.

Overall, the changes are meant to make SslBump more powerful and safer.
The code has been tested in several independent labs.

Specific major changes are highlighted below:

Make bumping algorithm selectable using ACLs. Even though
bump-server-first is an overall better method, bumping the client first
is useful for backward compatibility and possibly for serving internal
Squid objects (such as icons inside Squid error pages).  The following
example bumps special and most other requests only, using the old
bump-client-first approach for the special requests only:

    ssl_bump client-first specialOnes
    ssl_bump server-first mostOthers
    ssl_bump none all

It allow use the old ssl_bump syntax:
   ssl_bump allow/deny acl ...
but warns the user to update squid configuration.

Added sslproxy_cert_adapt squid.conf option to overwrite default mimicking
behavior when generating SSL certificates. See squid.conf.documented.

Added sslproxy_cert_sign squid.conf option to control how generated SSL
certificates are signed. See squid.conf.documented.

Added ssl::certHasExpired, ssl::certNotYetValid, ssl::certDomainMismatch,
ssl::certUntrusted, and ssl::certSelfSign predefined ACLs to squid.conf.

Do not require http[s]_port's key option to be set if cert option is given.
The fixed behavior for bumped connections now matches squid.conf docs.

Generate stable fake certificates by using signing and true certificate
hashes as the serial number and by using the configured CA private key
for all fake certificates.

Use minimal, trusted certificate for serving SSL errors to the client
instead of trying to mimic the broken true certificate (which results
in double error for the user: browser error dialog plus Squid error page).

To mimic "untrusted" true certificates, generate an untrusted CA certificate
from the configured trusted CA certificate. This both reduces configuration
effort (compared to a configuration option) and results in identical
untrusted fake certificates given identical Squid configurations.

Intelligent handling of CONNECT denials: Do not connect to origin
servers unless CONNECT is successfully authenticated. Delay errors.Added sslproxy_cert_sign squid.conf option to control how generated SSL
certificates are signed. See squid.conf.documented.

Provide '%I' error page formatting code with enough information to avoid
displaying '[unknown]' on SQUID_X509_V_ERR_DOMAIN_MISMATCH errors.

Set logged status code (%<Hs) to 200 when establishing a bumped tunnel.

Improved error detailing and logging: Forget most retried errors.
During SslBump errors, the error details are now logged with both the
initial CONNECT transaction and the first tunneled HTTP transaction.
Do not report system errors as custom Squid errors. Do not report
system errors that did not necessarily happen during the transaction
being logged.

Check SSL server certificate when reconnecting to the origin server for
bumped requests. Despite pinning, Squid maintains two separate connections
and the server may disconnect while the client is still sending requests. To
minimize deployment problems, we reconnect to the origin server but check
that its certificate (which we mimicked for the client) has not changed
much.

Forward bumped server connection-close signal to the bumped client to
improve the "dumb tunnel" appearance of the bumped SSL tunnel.

Allow bumping of CONNECT requests without allow-direct set on http_port.
Previously, that flag was required to allow bumped requests to go direct
because they were (and, sometimes, still are) considered "accelerated".

Send SNI information to the server when server-first bumping a non-IP
CONNECT request.

Better helper-to-Squid buffer size management to support large certificates.

Bypass rare OpenSSL certificate serialization failures when composing an
ssl_crtd request by generating the certificate in the Squid process.

When generating certificate CN names, strip [] surrounding host names,
assuming they are for IPv6 addresses. Bracketed CNs confuse browsers.

Disable persistent connections after client-side-detected errors. They cause
"abandoning such and such connection" warnings, stuck ConnStateData jobs, and
other problems.

HttpRequest::SetHost() must invalidate HttpRequest::canonical "cache".

Implement ssl::bump_mode logformat code to log SslBump decisions: prints "none",
"client-first", "server-first" or "-" for no ssl-bump enabled ports

Synced with trunk (trunk r12216, v3.2.0.18+)

This is a Measurement Factory project.

13 years agoBug 3478: Partial fix: Connection-auth on intercepted connections is broken
Christos Tsantilas [Wed, 18 Jul 2012 17:40:51 +0000 (20:40 +0300)] 
Bug 3478: Partial fix: Connection-auth on intercepted connections is broken
Currenty in the case of intercepted connections each request is open a new
connection to the destination server, even if the connection is a valid pinned
connection.
This patch fixes this problem and reuses pinned connections on intercepted
requests.

This is a Measurement Factory project

13 years agoBug 3551: store_rebuild.cc:116: "store_errors == 0" assertion
Alex Rousskov [Wed, 18 Jul 2012 17:17:27 +0000 (11:17 -0600)] 
Bug 3551: store_rebuild.cc:116: "store_errors == 0" assertion

Fail with an explanation instead of asserting. The assertion fails when a ufs
cache_dir's swap.state has inconsistencies AND the user starts Squid with a -S
command line option. Normally, such inconsistencies are ignored and many of
them are benign.  For example, a missing cache file with an ADD record in
swap.state is such an inconsistency.

The -S option was meant to help developers troubleshoot inconsistencies by
analyzing core dumps, but (a) admins treat assertions as Squid bugs and file
bug reports and (b) in most cases, it is really difficult to find the
inconsistency when Squid asserts after detecting all of them (and leaving the
detection context).

We now explicitly tell the admin what their options are and quit instead of
asserting.

TODO: Consider adding a ufs cache_dir option that checks for and removes
inconsistencies instead of not checking at all (default) or checking and
quitting (-S). This is difficult because some valid cache entries may look
inconsistent while they are being updated and some invalid cache entries
are not visible to Squid without a full directory scan.

13 years agomerge from trunk (r12216 v3.2.0.18+)
Christos Tsantilas [Wed, 18 Jul 2012 16:21:47 +0000 (19:21 +0300)] 
merge from trunk (r12216 v3.2.0.18+)

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Wed, 18 Jul 2012 15:47:58 +0000 (17:47 +0200)] 
Changed increment operators from postfix to prefix form.

13 years agoHandle Amos comments on bump-ssl-server-first patch
Christos Tsantilas [Wed, 18 Jul 2012 15:19:04 +0000 (18:19 +0300)] 
Handle Amos comments on bump-ssl-server-first patch

- Use "IF" instead of "IFDEF" in cf.data.pre. The IFDEF already used in the
  IDEF<colon> form.

- Add an assertion in setServerBump to assure that even if this method reused in
  a client request we will not try to change the existing bump mode

- Polish the code in  doCallouts method: wrap if(!calloutContext->error) { ... }
  around the whole section of callouts.

- The detailCode parameter in ErrorState::detailError(int detailCode) shadows
  the ErrorState::detailCode parameter.

- src/url.cc: Reverting change in urlParseFinish

- Allow old "ssl_bump allow/deny acl ..." syntax converting:
    * "ssl_bump allow" to "ssl_bump client-first"
    * "ssl-bump deny" to "ssl_bump none"
  Prints warning messages to urge users update their configuration.
  Does not allow to mix old and new configurations.

- Warnings and comment fixes

13 years agoBug 3525: Do not resend nibbled PUTs and avoid "mustAutoConsume" assertion.
Alex Rousskov [Wed, 18 Jul 2012 03:57:10 +0000 (21:57 -0600)] 
Bug 3525: Do not resend nibbled PUTs and avoid "mustAutoConsume" assertion.

The connected_okay flag was not set when we were reusing the connection.
The unset flag overwrote bodyNibbled() check, allowing FwdState to retry
a PUT after the failed transaction consumed some of the request body
buffer, triggering BodyPipe.cc:239: "mustAutoConsume" assertion.

We now set the connected_okay flag as soon as we get a usable connection
and do not allow it to overwrite the bodyNibbled() check (just in case).

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

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Tue, 17 Jul 2012 17:38:50 +0000 (19:38 +0200)] 
Changed increment operators from postfix to prefix form.

13 years agoAdd request_header_add option: add forgotten src/tests/stub_libformat.cc file
Christos Tsantilas [Tue, 17 Jul 2012 14:29:17 +0000 (17:29 +0300)] 
Add request_header_add option: add forgotten src/tests/stub_libformat.cc file

13 years agoAdd request_header_add option
Christos Tsantilas [Tue, 17 Jul 2012 14:25:06 +0000 (17:25 +0300)] 
Add request_header_add option

This patch:

- Add request_header_add, a new ACL-driven squid.conf option that
  allow addition of HTTP request header fields before the request is sent to
  the next HTTP hop (a peer proxy or an origin server):
     request_header_add <field-name> <field-value> acl1 [acl2]
  where:
     * Field-name is a token specifying an HTTP header name.

     * Field-value is either a constant token or a quoted string containing
       %macros. In theory, all of the logformat codes can be used as %macros.
       However, unlike logging the transaction may not yet have enough
       information to expand a macro when the new header value is needed.
       The macro will be expanded into a single dash ('-') in such cases.
       Not all macros have been tested.

     * One or more Squid ACLs may be specified to restrict header insertion to
       matching requests. The request_header_add option supports fast ACLs only.

- Add the %ssl::>cert_subject and %ssl::>cert_issuer logformating codes which
  prints the Subject field and Issuer field of the received client SSL
  certificate or a dash ('-').

This is a Measurement Factory project.

13 years agoConvert AccessLogEntry class to RefCountable
Christos Tsantilas [Tue, 17 Jul 2012 14:11:24 +0000 (17:11 +0300)] 
Convert AccessLogEntry class to RefCountable

The AccessLogEntry objects currently are only members of the ClientHttpRequest
objects. There are cases where we need to access AccessLogEntry from server
side objects to retrieve already stored informations for the client request and use it in
server side code with format/* interface (eg use Format::Format::assemble
inside http.cc)

This patch convert AccessLogEntry class to RefCountable to allow link it with
other than the ClientHttpRequest objects.

This is a Measurement Factory project.

13 years agoFixed typos in header mangling option notes.
Alex Rousskov [Mon, 16 Jul 2012 21:58:02 +0000 (15:58 -0600)] 
Fixed typos in header mangling option notes.

13 years agoMerged from trunk
Francesco Chemolli [Mon, 16 Jul 2012 13:49:18 +0000 (15:49 +0200)] 
Merged from trunk

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Mon, 16 Jul 2012 09:55:32 +0000 (11:55 +0200)] 
Changed increment operators from postfix to prefix form.
Fixed some int-as-bool useage.

13 years agoBug 3556 Workaround: epoll assertion failed: comm.cc:1093: isOpen(fd)
Amos Jeffries [Mon, 16 Jul 2012 05:26:42 +0000 (23:26 -0600)] 
Bug 3556 Workaround: epoll assertion failed: comm.cc:1093: isOpen(fd)

13 years agoRelease Notes: document squid-3.1 libecap known issue
Amos Jeffries [Sun, 15 Jul 2012 22:17:20 +0000 (10:17 +1200)] 
Release Notes: document squid-3.1 libecap known issue

13 years agoRelease Notes: document request/reply header mangler changes
Amos Jeffries [Sun, 15 Jul 2012 09:41:44 +0000 (03:41 -0600)] 
Release Notes: document request/reply header mangler changes

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 14 Jul 2012 00:14:36 +0000 (18:14 -0600)] 
SourceFormat Enforcement

13 years agoAdded MemStore::keepInLocalMemory() stub missing in r12205
Alex Rousskov [Fri, 13 Jul 2012 22:04:57 +0000 (16:04 -0600)] 
Added MemStore::keepInLocalMemory() stub missing in r12205
to make "make check" happier.

13 years agoRestore memory caching ability lost since r11969.
Dmitry Kurochkin [Fri, 13 Jul 2012 14:33:19 +0000 (08:33 -0600)] 
Restore memory caching ability lost since r11969.
Honor maximum_object_size_in_memory for non-shared memory cache.

Since r11969, Squid calls trimMemory() for all entries to release unused
MemObjects memory. Unfortunately, that revision also started trimming objects
that could have been stored in memory cache later. Trimmed objects are no
longer eligible for memory caching.

It is possible that IN_MEMORY check in StoreEntry::trimMemory() was preventing
excessive trimming in the past, but after SMP changes, IN_MEMORY flag is set
only after the object is committed to a memory cache in
StoreController::handleIdleEntry(), so we cannot rely on it. For example:

  clientReplyContext::removeStoreReference()

    storeUnregister()
      StoreEntry::swapOut()
        StoreEntry::trimMemory()
          StoreEntry::releaseRequest()

    StoreEntry::unlock()
      StoreController::handleIdleEntry() // never get here because entry is
        set IN_MEMORY status             // already marked for release

This change adds StoreController::keepForLocalMemoryCache() and
MemStore::keepInLocalMemory() methods to check if an entry could be stored in
a memory cache (and, hence, should not be trimmed). The store-related part of
the trimming logic has been moved from StoreEntry::trimMemory() to
StoreController::maybeTrimMemory(). StoreEntry code now focuses on checks that
are not specific to any memory cache settings or admission policies.

These changes may resulted in Squid honoring maximum_object_size_in_memory for
non-shared memory cache. We may have been ignoring that option for non-shared
memory caches since SMP changes because the check for it was specific to a
shared memory cache.

13 years agoChanged increment operators from postfix to prefix form.
Francesco Chemolli [Fri, 13 Jul 2012 10:48:12 +0000 (12:48 +0200)] 
Changed increment operators from postfix to prefix form.

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

13 years agoPolish: improve debug about which helper FD are failing
Amos Jeffries [Thu, 12 Jul 2012 23:39:04 +0000 (17:39 -0600)] 
Polish: improve debug about which helper FD are failing

13 years agoChanged increment/decrement operators from postfix to prefix form.
Francesco Chemolli [Thu, 12 Jul 2012 14:10:53 +0000 (16:10 +0200)] 
Changed increment/decrement operators from postfix to prefix form.

13 years agoChanged increment/decrement operators from postfix to prefix form.
Francesco Chemolli [Thu, 12 Jul 2012 09:08:16 +0000 (11:08 +0200)] 
Changed increment/decrement operators from postfix to prefix form.

13 years agoBug 3577: File Descriptors not properly closed in trunk r12185.
Amos Jeffries [Tue, 10 Jul 2012 23:35:14 +0000 (17:35 -0600)] 
Bug 3577: File Descriptors not properly closed in trunk r12185.
Bug 3583: Server connection stuck after TCP_REFRESH_UNMODIFIED.

These changes fix FD leaks and stuck connections under two conditions:

1) Client aborts while Squid's server-side establishes a connection

Bug 3577: When a client quits while ConnOpener is trying to open the
connection to the next hop, FwdState cancels its ConnOpener callback.
ConnOpener notices that when trying to connect again and quits before
establishing a connection. The ConnOpener cleanup code did not close the
temporary FD used for establishing the connection. It did call fd_close(),
but fd_close() does not close the FD, naturally.

ConnOpener was probably leaking the temporary FD in other error handling
cases as well. It was never closed unless the connection was successful.

2) Client aborts after Squid's server-side established a connection:

Bug 3583: When a client aborts the store entry after receiving an HTTP 304 Not
Modified reply in response to a cache refreshing IMS request, HttpStateData
notices an aborted Store entry (after writing the reply to store), but does
virtually nothing, often resulting in a stuck server connection, leaking a
descriptor.  Now we abort the server-side transaction in this case.

Bug 3577: Similarly, when a client disconnects after Squid started talking to
the origin server but before Squid received a [complete] server response,
HttpStateData notices an aborted Store entry (during the next read from the
origin server), but does virtually nothing, often resulting in a stuck server
connection, leaking a descriptor. Now we abort the server-side transaction in
this case.

FwdState now also closes the server-side connection, if any, when the client
aborts the store entry and FwdState::abort() callback is called. This helps
reduce the number of concurrent server-side connections when clients abort
connections rapidly as Squid no longer has to wait for the server-side I/O to
notice that the entry is gone. The code to close the connection was temporary
removed in trunk r10057.1.51.

13 years agoLog original async call cancellation reason, not just the repeated ones.
Alex Rousskov [Tue, 10 Jul 2012 20:37:04 +0000 (14:37 -0600)] 
Log original async call cancellation reason, not just the repeated ones.

13 years agoChanged increment/decrement operators from postfix to prefix form.
Francesco Chemolli [Tue, 10 Jul 2012 15:44:23 +0000 (17:44 +0200)] 
Changed increment/decrement operators from postfix to prefix form.