]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 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

12 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

12 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

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

12 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

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

12 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+)

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

12 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

12 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).

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

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

12 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

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

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

13 years agoBug 3584: Detection of setresuid() is broken
Ole Christensen [Mon, 9 Jul 2012 02:35:45 +0000 (14:35 +1200)] 
Bug 3584: Detection of setresuid() is broken

13 years agocache.log analysis: Add a pattern to report alive (opened and not closed) FDs.
Alex Rousskov [Fri, 6 Jul 2012 22:35:28 +0000 (16:35 -0600)] 
cache.log analysis: Add a pattern to report alive (opened and not closed) FDs.

13 years agochanged postinc to preinc operators and increased readability in ModSelect.cc
Francesco Chemolli [Fri, 6 Jul 2012 12:19:11 +0000 (14:19 +0200)] 
changed postinc to preinc operators and increased readability in ModSelect.cc

13 years agoImproved readability in some prefix increment/decrement operators.
Francesco Chemolli [Fri, 6 Jul 2012 10:18:43 +0000 (12:18 +0200)] 
Improved readability in some prefix increment/decrement operators.

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

13 years ago[request|reply]_header_* manglers patch: fix build error
Christos Tsantilas [Thu, 5 Jul 2012 21:35:27 +0000 (00:35 +0300)] 
[request|reply]_header_* manglers patch: fix build error

13 years ago[request|reply]_header_* manglers patch: fix build error
Christos Tsantilas [Thu, 5 Jul 2012 16:39:21 +0000 (19:39 +0300)] 
[request|reply]_header_* manglers patch: fix build error

13 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Christos Tsantilas [Thu, 5 Jul 2012 14:38:28 +0000 (17:38 +0300)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
[request|reply]_header_* manglers fixes to handle custom headers

This patch fix the [request|reply]_header_[access|replace] configuration
parameters to support custom headers. Before this patch the user was able
to remove/replace/allow all custom headers using the "Other" as header name.

This is a Measurement Factory project.

13 years agoMerged from trunk
Francesco Chemolli [Mon, 2 Jul 2012 15:31:32 +0000 (17:31 +0200)] 
Merged from trunk

13 years agoPrefix-to-postfix increment operator change in some helpers.
Francesco Chemolli [Mon, 2 Jul 2012 15:31:03 +0000 (17:31 +0200)] 
Prefix-to-postfix increment operator change in some helpers.

13 years agoSmall optimization in CommOpener statistic accounting.
Francesco Chemolli [Mon, 2 Jul 2012 15:30:02 +0000 (17:30 +0200)] 
Small optimization in CommOpener statistic accounting.

13 years agoChange increment and decrement operators from postfix to prefix form.
Francesco Chemolli [Mon, 2 Jul 2012 12:37:13 +0000 (14:37 +0200)] 
Change increment and decrement operators from postfix to prefix form.

13 years agoChange increment and decrement operators from postfix to prefix form.
Francesco Chemolli [Mon, 2 Jul 2012 12:28:10 +0000 (14:28 +0200)] 
Change increment and decrement operators from postfix to prefix form.

13 years agoChange increment and decrement operators from postfix to prefix form.
Francesco Chemolli [Mon, 2 Jul 2012 12:14:07 +0000 (14:14 +0200)] 
Change increment and decrement operators from postfix to prefix form.

13 years agoAdd helper macro for parser deprecation notes
Amos Jeffries [Mon, 2 Jul 2012 01:50:03 +0000 (13:50 +1200)] 
Add helper macro for parser deprecation notes

When '-k parse' is used deprecation notices and upgrade help messages etc
need to be bumped consistently up to level-0 and this macro will help
reducing the (?:) code mistakes.

13 years agoFixed building with --disable-ssl. BumpSslServerFirst.take10
Alex Rousskov [Sun, 1 Jul 2012 04:35:24 +0000 (22:35 -0600)] 
Fixed building with --disable-ssl.

13 years agoAdded ssl::bump_mode logformat code to log SslBump decisions.
Alex Rousskov [Sun, 1 Jul 2012 03:55:21 +0000 (21:55 -0600)] 
Added ssl::bump_mode logformat code to log SslBump decisions.

Reshuffled (a little) how the bumping decision for CONNECT is made to
streamline the code. This was necessary to consistently distinguish '-' from
'none' logged modes.

Do not evaluate ssl_bump when we are going to respond to a CONNECT request
with an HTTP 407 (Proxy Authentication Required) or with a redirect response.
Such evaluation was pointless because the code never bumps in such cases
because, unlike regular errors, these responses cannot be delayed and served
later inside the bumped tunnel.

13 years agoTypos
Amos Jeffries [Fri, 29 Jun 2012 01:28:05 +0000 (13:28 +1200)] 
Typos

13 years agoBug 3581: Wrong years in ChangeLog
Amos Jeffries [Fri, 29 Jun 2012 01:07:52 +0000 (19:07 -0600)] 
Bug 3581: Wrong years in ChangeLog

13 years agoPrep for 3.2.0.18
Amos Jeffries [Fri, 29 Jun 2012 00:57:50 +0000 (18:57 -0600)] 
Prep for 3.2.0.18

13 years agoRemoved FilledChecklist::checkCallback() as harmful and not needed.
Alex Rousskov [Thu, 28 Jun 2012 18:26:44 +0000 (12:26 -0600)] 
Removed FilledChecklist::checkCallback() as harmful and not needed.

The method was resetting the authentication state (auth_user_request) of a
connection just before notifying the caller of the async ACL check result. The
reset restarts authentication sequence, creating a 407 "loop" for auth schemes
that require more than one step (e.g., NTLM).

The method is no longer needed because we do not need to explicitly "unlock"
auth_user_request anymore. It is refcounted now.

There are other cases where connection authentication state () is reset from
within the ACL code. Some of those cases are not needed and some might even
cause similar bugs, but I did not risk misclassifying them in this commit.

13 years agoDo not double-escape %R on deny_info redirects
Amos Jeffries [Wed, 27 Jun 2012 19:15:28 +0000 (07:15 +1200)] 
Do not double-escape %R on deny_info redirects

13 years agoBug 3576: ICY streams being Transfer-Encoding:chunked
Amos Jeffries [Mon, 25 Jun 2012 07:43:36 +0000 (19:43 +1200)] 
Bug 3576: ICY streams being Transfer-Encoding:chunked

13 years agoFix build with GCC 4.7 (and probably other C++11 compilers).
Dmitry Kurochkin [Fri, 22 Jun 2012 03:49:38 +0000 (21:49 -0600)] 
Fix build with GCC 4.7 (and probably other C++11 compilers).

User-defined literals introduced by C++11 break some previously valid
code, resulting in errors when building with GCC v4.7. For example:

  error: unable to find string literal operator 'operator"" PRIu64'

In particular, whitespace is now needed after a string literal and
before something that could be a valid user-defined literal.  See
"User-defined literals and whitespace" section at [1] for more details.

The patch adds spaces between string literals and macros.

[1] http://gcc.gnu.org/gcc-4.7/porting_to.html

13 years agoDo not report the same job multiple times.
Alex Rousskov [Thu, 21 Jun 2012 20:59:23 +0000 (14:59 -0600)] 
Do not report the same job multiple times.

13 years agoIf we re-pin, we must re-initialize SSL. BumpSslServerFirst.take09
Alex Rousskov [Wed, 20 Jun 2012 23:03:53 +0000 (17:03 -0600)] 
If we re-pin, we must re-initialize SSL.

The latest merge-from-trunk broke this logic because it disabled SSL
initialization for pinned connections.

13 years agoMore comments and docs polishing.
Alex Rousskov [Wed, 20 Jun 2012 21:26:13 +0000 (15:26 -0600)] 
More comments and docs polishing.

13 years agoCleanup: disconnect Authentication and URL-rewrite callback handlers
Amos Jeffries [Tue, 19 Jun 2012 23:16:13 +0000 (11:16 +1200)] 
Cleanup: disconnect Authentication and URL-rewrite callback handlers

The authentication handlers were for some reason using RH (rewrite helper)
callback typedef. But specifying it as a fatal error if the char*
parameter was used in auth.

Assign a new callback typedef AUTHCB for use by authentication callers.

This allows auth callers to use different parameters (none) and to avoid
possibly fatal mistakes when coding new auth modules.

13 years agoPolished names, comments, and code formatting.
Alex Rousskov [Tue, 19 Jun 2012 21:51:49 +0000 (15:51 -0600)] 
Polished names, comments, and code formatting.

13 years agoMerged from trunk (r12181, v3.2.0.17+)
Alex Rousskov [Tue, 19 Jun 2012 16:08:52 +0000 (10:08 -0600)] 
Merged from trunk (r12181, v3.2.0.17+)

13 years agoAccount for Store disk client quota when bandwidth-limiting the server.
Alex Rousskov [Mon, 18 Jun 2012 23:13:05 +0000 (17:13 -0600)] 
Account for Store disk client quota when bandwidth-limiting the server.

It is not clear why the store client type matters when
MemObject::mostBytesAllowed() is trying to find the maximum delay pool
quota for reading from the next hop HTTP server.  Whether the client(s)
are reading from disk or RAM, the corresponding server-side bandwidth
ought to be limited.

This code was removed as a part of bug 3462 investigation, but it is not
needed to fix bug 3462.

13 years agoBug 3462: Delay Pools and ICAP
Julien Pinon [Mon, 18 Jun 2012 23:08:56 +0000 (17:08 -0600)] 
Bug 3462: Delay Pools and ICAP

Allow StoreEntry::bytesWanted() API to ignore delay pools. Use that
feature when shoveling adapted response body from ICAP/eCAP BodyPipe
into Store.

If we do not ignore delay pools in
ServerStateData::handleMoreAdaptedBodyAvailable() context, and our pool
quota is exhausted, we will stop reading from the adaptation BodyPipe,
but there is no code/API to notify a BodyPipe reader when the quota
becomes available again.  With no reads from the pipe, the ICAP service
stops sending more adapted body data and possibly stops reading the
virgin body data from Squid, resulting in a stuck ICAP RESPMOD and the
master HTTP transaction.

We do need to call StoreEntry::bytesWanted() in this context because
otherwise Squid may run out of RAM (Squid bug #2619). The fix for that
problem inadvertently created this bug when delay pools were enabled.

Long-term, a "kick BodyPipe consumer when there is quota" code should be
added, and delay pools should be enabled for ICAP responses, but with
enough knobs for admins to disable ICAP pooling where needed. Most ICAP
environments will probably want to disable bandwidth controls because
ICAP service traffic is usually "local".

Removed StoreEntry::bytesWanted() TRY_FWD_HDR_WAIT guard that disabled
delay pool application until the final HTTP response headers are
received (HttpStateData::haveParsedReplyHeaders() is called). Nobody
could fully explain why that condition was really needed (and we
obviously want to limit bandwidth consumption at all response processing
stages, in general). The now-removed guard was bypassing delay pool
checks for virgin HTTP response (until the ICAP server responded with
adapted headers), causing bandwidth overuse.

Possibly fixes or helps with Squid bug #2606 as well.

13 years agoBug 2976: squid reports ERR_INVALID_URL for transparently captured requests when...
Christos Tsantilas [Mon, 18 Jun 2012 15:43:05 +0000 (18:43 +0300)] 
Bug 2976: squid reports ERR_INVALID_URL for transparently captured requests when reconfiguring

During reconfigure the configured AnyP::PortCfg objects in http_port_list
may deleted so it is not safe to use them while processing Http requests.
For this reason inside prepareTransparentURL (file client_side.cc) function
the protocol was hard-coded to "http" instead of read it from the related
AnyP::PortCfg object.
But this is breaks the intercepted https traffic.

This patch:
  1. Inside prepareTransparentURL read the protocol from the related
     AnyP::PortCfg object
  2. add_http_port() locks the new port pointer before linking it.
  3. parsePortCfg() locks the new port pointer before linking it.
  4. free_PortCfg() unlock the old port pointer before unlinking
     it. It does not delete the old pointer.

This patch also discussed in squid-dev user mailing list in
 "Re: [PATCH] Squid host rewrite for intercepted https requests"
thread.

This is a Measurement Factory project

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 17 Jun 2012 01:19:07 +0000 (19:19 -0600)] 
SourceFormat Enforcement

13 years agoLanguage: hy updates
Arthur Tumanyan [Sun, 17 Jun 2012 00:01:36 +0000 (12:01 +1200)] 
Language: hy updates

13 years agoFix several ACL-related bugs including broken default rules and ACCESS_DUNNO.
Alex Rousskov [Sat, 16 Jun 2012 15:03:46 +0000 (09:03 -0600)] 
Fix several ACL-related bugs including broken default rules and ACCESS_DUNNO.

For example:

    # broken when "goodGuys" matches (denies good guys)
    acl_driven_option deny !goodGuys

and

    # broken if badGuys fails to match or mismatch (allows bad guys)
    acl_driven_option allow !badGuys

Fixing the above resulted in significant changes (and more fixes!)
detailed below.

 * Revised ACLChecklist::fastCheck() and nonBlockingCheck() APIs to
   clarify all possible outcomes and to specify that exceptional ACL
   check outcomes (not ALLOW or DENIED) are not ignored/skipped but
   result in the same exceptional final answer. I believe this is the
   right behavior even if it is going to break some [already broken
   IMHO] existing configurations. Skipping failed ACLs is insecure and
   may lead to confusing results.

 * Correctly handle cases where no rules were matched and, hence, the
   keyword/action of the last seen rule (if any) has to be "reversed".

 * Do not ignore non-allow/deny outcomes of rules in fastCheck().

 * Move away from setting the "default" (and usually wrong) "current"
   answer and then sometimes adjusting it. Set the answer only when we
   know what it is. This is done using markFinished() call which now
   accepts the [final] answer value and debugging reason for selecting
   that answer.

 * Streamline and better document ACLChecklist::matchAclList()
   interface.  Use it in a more consistent fashion.

 * Rewrote ACLChecklist::matchAclList() implementation when it comes to
   handling ACLList::matches() outcomes. Better document and restrict
   supported outcomes. Assert on unsupported outcomes (for now).

 * Removed ACLChecklist::lastACLResult(). It was doing nothing but
   duplicating nodeMatched value as far as I could tell.

 * Removed ProxyAuthNeeded class. It is an async state that does not
   perform async operations and, hence, is not needed.

 * Move IdentLookup::checkForAsync() connection check into
   ACLIdent::match() to avoid creating an async state that is not
   needed.

 * Polished aclMatchExternal() and greatly simplified
   ACLExternal::ExternalAclLookup() to avoid creating async state under
   non-async conditions, to avoid checking for the same conditions
   twice, to fix wrong debugging messages, and to simplify (and possibly
   fix) the overall algorithm.

   The aclMatchExternal() call now checks most of the corner cases,
   discards stale cached entries, and schedules either a background
   cache update or a regular external lookup as needed.

   ACLExternal::ExternalAclLookup() code is now
   ExternalACLLookup::Start().  It initiates an external lookup. It does
   not deal with the cached entry at all. It relies on
   aclMatchExternal() to check various preconditions.

   Some of the old code made little sense to me, and this is the biggest
   ACL-specific change in this project, with the highest probability of
   new bugs or unintended side-effects.

   My goal here was to prevent aclMatchExternal() from creating an async
   state where none was needed because new ACLChecklist::matchAclList()
   code prohibited such self-contradictory outcomes. However, I later
   discovered that it is not possible to prohibit them without rewriting
   how Squid DNS cache lookups are working -- ipcache_nbgethostbyname()
   and similar code may call back immediately if the item is in the
   cache. Since I did not want to rewrite DNS code as well, I ended up
   relaxing the ACLChecklist::matchAclList() code requirements, going a
   step back to where we sometimes call ACLList::matches() twice for the
   same ACL node.

   Thus, it is probably possible to undo most of the external_acl.cc
   changes.  I left them in because I think they improve the quality of
   the code and possibly fix a bug or two.

 * Adjusted ACLMaxUserIP::match(), ACLProxyAuth::match(), and
   ACLExternal::match() to explicitly stop ACL processing when an
   exceptional state is discovered instead of just setting the current
   answer and proceeding as if more ACLs could be checked. On the other
   hand, we now do not set the answer if the corresponding internal
   matching code (e.g., AuthenticateAcl()) needs an async operation
   because we do not know the answer yet.

 * Fixed HttpStateData::handle1xx() and
   HttpStateData::finishingBrokenPost() to correctly handle
   fastCheck(void) return values. They were assuming that there are only
   two possible return values (ACCESS_DENIED/ALLOWED), potentially
   subjecting more messages to invasive adaptations than necessary.

TODO:

 * Rename currentAnswer() to finalAnswer(). We probably never change the
   "current" answer any more.

13 years agoBug 3405: ssl_crtd crashes failing to remove certificate
Alex Rousskov [Sat, 16 Jun 2012 02:17:14 +0000 (20:17 -0600)] 
Bug 3405: ssl_crtd crashes failing to remove certificate

13 years agoNon-bumping broken for intercept
Christos Tsantilas [Thu, 14 Jun 2012 21:48:10 +0000 (00:48 +0300)] 
Non-bumping broken for intercept

When an intercepted SSL connection matches "ssl_bump none" in
squid.conf, Squid correctly refuses to bump it and establishes a TCP
tunnel using a fake CONNECT request. Unfortunately, the HTTP client
terminates with an "unknown protocol" SSL error.

Also the client_dst_passthru does not work as expected for intercepted requests

13 years agoFix testHttpParser compile error 'variable tracking size limit exceeded'
Amos Jeffries [Wed, 13 Jun 2012 03:17:53 +0000 (15:17 +1200)] 
Fix testHttpParser compile error 'variable tracking size limit exceeded'

This can occur due to long lists of unit tests needing a lot of local
variable state tracking. Essentially 'function too long' after CPPUNIT
macros have been expanded.

Break the large set of request-line unit tests into groups related to
sub-parts of the request-line.

13 years agoBug 3561: cbdata cookie assertion after bug #3505 fix.
Alex Rousskov [Tue, 12 Jun 2012 14:41:36 +0000 (08:41 -0600)] 
Bug 3561: cbdata cookie assertion after bug #3505 fix.

13 years agoSQL database session helper
Amos Jeffries [Tue, 12 Jun 2012 08:50:53 +0000 (20:50 +1200)] 
SQL database session helper

Session lookup helper which utilizes any SQL database backend.

For now it is a read-only session lookup. Session management is expected
to be controlled by an external system, such as a captive portal login
page.

13 years agoPerformance: ACLFilledChecklist fills istelf from HttpRequest
Amos Jeffries [Tue, 12 Jun 2012 07:01:02 +0000 (01:01 -0600)] 
Performance: ACLFilledChecklist fills istelf from HttpRequest

13 years agoBug 3564: eCAP not supporting CoAP URI schemes
Amos Jeffries [Mon, 11 Jun 2012 06:03:50 +0000 (00:03 -0600)] 
Bug 3564: eCAP not supporting CoAP URI schemes

13 years agoFixed typo in r12165 (Bug 2138: NTLM passthrough using accel peer and ssl)
Alex Rousskov [Fri, 8 Jun 2012 15:10:10 +0000 (09:10 -0600)] 
Fixed typo in r12165 (Bug 2138: NTLM passthrough using accel peer and ssl)

13 years agossl_crtd compile issues with libsslutil
Alexander Komyagin [Fri, 8 Jun 2012 11:33:21 +0000 (05:33 -0600)] 
ssl_crtd compile issues with libsslutil

13 years agoPrep for 3.1.20
Amos Jeffries [Fri, 8 Jun 2012 11:00:03 +0000 (05:00 -0600)] 
Prep for 3.1.20

13 years agoStart ssl_crtd even if only https_port(s) are configured to bump SSL.
Alex Rousskov [Thu, 7 Jun 2012 17:46:16 +0000 (11:46 -0600)] 
Start ssl_crtd even if only https_port(s) are configured to bump SSL.

The right code was deleted during a recent trunk merge.

13 years agoBug 3526: permit high-speed nonce regeneration
Frederic Bourgeois [Thu, 7 Jun 2012 10:27:46 +0000 (04:27 -0600)] 
Bug 3526: permit high-speed nonce regeneration

13 years agoBug 2138: NTLM passthrough using accel cache_peer and ssl
Juan [Wed, 6 Jun 2012 00:28:11 +0000 (18:28 -0600)] 
Bug 2138: NTLM passthrough using accel cache_peer and ssl

13 years agoDrop dead include from xusleep.c
Amos Jeffries [Tue, 5 Jun 2012 23:55:22 +0000 (17:55 -0600)] 
Drop dead include from xusleep.c

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 5 Jun 2012 00:23:48 +0000 (18:23 -0600)] 
SourceFormat Enforcement

13 years agoRemove xcountws PROF_type
Amos Jeffries [Mon, 4 Jun 2012 10:03:11 +0000 (04:03 -0600)] 
Remove xcountws PROF_type

13 years agoCleanup: remove xcountws() function
Amos Jeffries [Mon, 4 Jun 2012 10:00:44 +0000 (04:00 -0600)] 
Cleanup: remove xcountws() function

Reduces dependencies and removes one more unnecessary symbol