]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
13 years agoDo not swap out already swapped out objects.
Alex Rousskov [Sat, 25 Feb 2012 04:20:25 +0000 (21:20 -0700)] 
Do not swap out already swapped out objects.

I noticed that sometimes Squid would start swapping out an entry that was
recently loaded from disk and was still on disk. That wastes disk
resources (at best).

The old StoreEntry::mayStartSwapOut() code assumed that when swap_status is
not SWAPOUT_NONE it is SWAPOUT_WRITING, but SWAPOUT_WRITING is impossible
after recent StoreEntry::swapOut() modifications because mayStartSwapOut() is
only called when we are not swappingOut() already. SWAPOUT_DONE is possible.

13 years agoDrop dead code in reply parsing
Amos Jeffries [Sat, 25 Feb 2012 04:19:26 +0000 (21:19 -0700)] 
Drop dead code in reply parsing

This code has not been used/needed in some time. It can die.

It is also no clear why it existed in the first place. The RFC is not
mentioned by number and RFC 2068/2616 only talk about tolerance for
whitespace before request lines, not replies.

13 years agoBug 3490: part 1: SegFault opening FTP active data connections
Amos Jeffries [Sat, 25 Feb 2012 04:18:44 +0000 (21:18 -0700)] 
Bug 3490: part 1: SegFault opening FTP active data connections

13 years agoAdd debugs for NTLM domain decode errors
Amos Jeffries [Sat, 25 Feb 2012 04:15:22 +0000 (21:15 -0700)] 
Add debugs for NTLM domain decode errors

13 years agoSourceLayout: shuffle CommIO into DiskThreads library
Amos Jeffries [Sat, 25 Feb 2012 04:14:25 +0000 (21:14 -0700)] 
SourceLayout: shuffle CommIO into DiskThreads library

While investigating the Windows port problems it became clear that the
CommIO object is not actually related to the rest of comm systems. It is
instead a dedicated higher level disk I/O pipe manager for DiskThreads.

Given that it causes build errors in comm.cc on Windows and does not
even need to be there this patch shuffles it into the DiskThreads
library. The build issues on Windows still exist but are now limited to
just that threads library and can be avoided temporarily with simple
./configure options.

13 years ago3.2.0.15 SQUID_3_2_0_15
Amos Jeffries [Sun, 5 Feb 2012 13:27:27 +0000 (06:27 -0700)] 
3.2.0.15

13 years agoPrep for 3.1.19 and 3.2.0.15
Amos Jeffries [Sun, 5 Feb 2012 11:43:06 +0000 (04:43 -0700)] 
Prep for 3.1.19 and 3.2.0.15

13 years agoSilence messages about MGR_INDEX when not installed
Amos Jeffries [Sun, 5 Feb 2012 11:37:57 +0000 (04:37 -0700)] 
Silence messages about MGR_INDEX when not installed

13 years agoBug 3441: part 2: Prevent further cache size corruption of swap.state
Alex Rousskov [Sun, 5 Feb 2012 07:29:54 +0000 (00:29 -0700)] 
Bug 3441: part 2: Prevent further cache size corruption of swap.state

13 years agoFixed debugging line: '<<' has higher precedence than '?:'.
Alex Rousskov [Sun, 5 Feb 2012 06:37:08 +0000 (23:37 -0700)] 
Fixed debugging line: '<<' has higher precedence than '?:'.

13 years agoBug 3478: pt1: Host verify catching dynamic CDN hosted sites
Amos Jeffries [Sun, 5 Feb 2012 06:35:38 +0000 (23:35 -0700)] 
Bug 3478: pt1: Host verify catching dynamic CDN hosted sites

This add a bit more leniency to the Host: header validation without
re-opening Squid to the cache poisoning risks involved.Resolving most
issues with websites using geo-based DNS results and/or short DNS TTL for
load balancing.

It alters host_verify_strict directive to allow requests which fail Host:
validation to continue through processing. The default remains OFF.

* blocks caching on the response to protect all other network clients
  against one compromised client spreading infections.

* forces the original (untrusted) destination IP to be used instead of
  any alternative Squid might find. Preventing Squid or peer DNS lookup
  being the point of vulnerability for the same-origin bypass. For any
  client to be vulnerable it must be vulnerable inside the browser agent
  where the original TCP connection is established.

Also add a new error template ERR_CONFLICT_HOST to replace the confusing
"invalid request" message with a clear explanation of the problem and
some client workarounds.

FUTURE WORK:
* adapt processing to allow these requests to safely be passed to peers.
* adapt caching to permit safe sharing between clients making identical
  requests to same sources.

13 years agoRenamed squid.h to squid-old.h and config.h to squid.h
Francesco Chemolli [Sun, 5 Feb 2012 06:09:46 +0000 (23:09 -0700)] 
Renamed squid.h to squid-old.h and config.h to squid.h

13 years agoBug 3441: Part 1: Minimize cache size corruption by malformed swap.state.
Alex Rousskov [Thu, 2 Feb 2012 08:48:59 +0000 (01:48 -0700)] 
Bug 3441: Part 1: Minimize cache size corruption by malformed swap.state.

If swap.state gets corrupted, a single entry with bogus size value will screw
up Squid idea of the current cache size. A newly added StoreSwapLogData sane()
method attempts to minimize the chance of corruption by ignoring log entries
with obviously bogus values.

However, without expensive size checks (-S or "Does the log entry matches the
actual cache file size?"), it is not possible to reliably detect all bogus log
entries.

If Squid gets a wrong idea of the current cache size, it may either cache too
much (and possibly run out of space) OR delete everything.

13 years agoBug 3268: remove wrong 'Ready to serve requests.' message
Amos Jeffries [Fri, 27 Jan 2012 13:42:36 +0000 (06:42 -0700)] 
Bug 3268: remove wrong 'Ready to serve requests.' message

13 years agoBug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)
Alex Rousskov [Fri, 27 Jan 2012 13:03:56 +0000 (06:03 -0700)] 
Bug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)

Properly initialize memory_cache_shared when not explicitly configured and
do not allocate shared memory segments if memory_cache_shared is off.

Prior to this change, shared memory was requested (during rrClaimMemoryNeeds)
before memory_cache_shared was initialized (during rrAfterConfig, unless
explicitly set in squid.conf). Moreover, MemStore::EntryLimit() calculation
ignored memory_cache_shared setting. All that resulted in an attempt to create
shared memory segments where none were needed or possible.

We now have a new Runners Registry (rrFinalizeConfig) that is dedicated to
finalizing complex configuration options, before those configurations options
are used to initialize modules, features, and services. As far as shared
memory is concerned, the initialization order is now:

  * rrFinalizeConfig: finalize memory_cache_shared if needed
  * rrClaimMemoryNeeds: request shared memory pages for the caches
  * rrAfterConfig: create shared memory segments

The same bug 3449 also needed a fix for shared segment paths (trunk r11961).

13 years agoBug 3268: Squid cannot do anything else during ufs/diskd rebuild
Alex Rousskov [Fri, 27 Jan 2012 13:01:52 +0000 (06:01 -0700)] 
Bug 3268: Squid cannot do anything else during ufs/diskd rebuild

Replaced 50-entries/step UFS rebuild logic with 50msec/step logic,
while also ensuring that other events can be processed between steps.

During a swap.state rebuild, progress reporting will now happen
every 4000 entries instead of every 0xFFF entries because humans do not
think in hex. Still no progress reporting for dirty rebuilds based on the
cache directory scans.

The code is based on Rock Store rebuild code. Eventually, the common rebuild
pacing logic among all stores should be merged to avoid code duplication.

Also removed RebuildState::next methods as unused. A copy-paste error?

13 years agoDisable OpenSSL SSL/TLS bug workarounds by default
Henrik Nordstrom [Fri, 27 Jan 2012 12:52:44 +0000 (05:52 -0700)] 
Disable OpenSSL SSL/TLS bug workarounds by default

On a closer inspection the set of "harmless" SSL/TLS bug workarounds
set by SSL_OP_ALL is not all of them harmless and reduces the SSL/TLS
strength to some attacks.

To revert to the older mode the ALL option can be set explicitly, but
it's better to understand which bug is encountered and enable only that
specific workaround if needed.

13 years agoGCC 4.7 fix
Jiri Skala [Fri, 27 Jan 2012 12:51:23 +0000 (05:51 -0700)] 
GCC 4.7 fix

13 years agoSend DNS A and AAAA queries in parallel
Henrik Nordstrom [Fri, 27 Jan 2012 12:47:06 +0000 (05:47 -0700)] 
Send DNS A and AAAA queries in parallel

This implements sending DNS A & AAAA queries in parallel by
creating "slave" idns_query requests. Current implementation
uses the A lookup as "master" and AAAA as "slave" query.

Long term this should probably be restructured to separate "lookup
state" and "query", or even better yet to defer the DNS lookups
until connect time and perform A respective AAAA as needed only and
not look up both before attemting to connect.

This also drops the dns_v4_fallback directive as it have no effect with
parallel DNS lookups. This directive should be reinstanciated in future
to enable pure IPv6 usage.

13 years agotrimMemory for unswappable objects
Christos Tsantilas [Fri, 27 Jan 2012 12:40:00 +0000 (05:40 -0700)] 
trimMemory for unswappable objects

Inside StoreEntry::swapOut() the StoreEntry::trimMemory() method called to
release unused MemObjects memory. The trimMemory method must called for all
store entries, but current code blocks that call for not-swappable objects,
at least.

This patch trying to fix this bug implementing the following simple logic:
   {
     bool weAreOrMayBeSwappingOut =
           swappingOut() || mayStartSwapout();

     trimMemory(weAreOrMayBeSwappingOut);

     if (!weAreOrMayBeSwappingOut)
         return; // nothing else to do
   }

This is a Measurement Factory project

13 years agoCache Manager migration support
Amos Jeffries [Fri, 27 Jan 2012 12:33:17 +0000 (05:33 -0700)] 
Cache Manager migration support

* Add a little bit of XHR script to the CGI cachemgr front page which
probes each of the managed proxies for http:// and https:// capabilities
and produces web links to their internal managers.

* Reserve the template name MGR_INDEX for use by cachemgr scripts.
But do not distribute any preset template. This allows manager apps to
provide their own static template with linked scripts and objects.

* The error page system is updated to create a blanket message
indicating missing template instead of aborting Squid if a template is
not even installed.

Also, add Cross-Origin Request Support for the cache manager API

Now that tools are being implemented to access the cache manager via
http:// scheme we need to accomodate the browser XSS protection
mechanisms which limit XHR based scripts abilities.

This adds CORS headers to manager responses. Permitting XHR to view the
Server header (to detect squid version for known capabilities) and to
flag that the XHR request may need access to credentials for
authenticating with the manager.

This also closes the feature bug 3407 requesting we support the
non-standard "Origin:" header, which is used by the CORS mechanisms.

Future work:
  Support the OPTIONS request used by CORS to detect requirements before
  POSTing. We do not yet use POST in the Squid code so that is left until
  needed.

13 years agoDo not add HTTP 110 and 111 Warnings to TCP_REFRESH_UNMODIFIED responses.
Alex Rousskov [Sat, 21 Jan 2012 01:13:53 +0000 (18:13 -0700)] 
Do not add HTTP 110 and 111 Warnings to TCP_REFRESH_UNMODIFIED responses.

The old "stale if hit" logic did not account for cases where the stored
stale response became fresh due to a successful revalidation with the
origin server.
When the stored response was stale at the time of the request, we were
adding 110 "Response is stale" and even 111 "Revalidation failed"
Warning headers to responses while logging TCP_REFRESH_UNMODIFIED, which
is considered a hit.

13 years agoBug 3472: segfault with the message 'urlParse: URL too large'
Christos Tsantilas [Tue, 17 Jan 2012 08:46:52 +0000 (01:46 -0700)] 
Bug 3472: segfault with the message 'urlParse: URL too large'

13 years agoBug 3471: Segfault when %la formating code used
Christos Tsantilas [Tue, 17 Jan 2012 08:45:56 +0000 (01:45 -0700)] 
Bug 3471: Segfault when %la formating code used

13 years agoPolish compat library xfree/xxfree
Amos Jeffries [Tue, 17 Jan 2012 08:42:20 +0000 (01:42 -0700)] 
Polish compat library xfree/xxfree

* remove xxfree() entirely it has been a useless wrapper for free_const()
  for some time now.

* update replace xfree() to a static inline function to permit better
  compiler optimization

13 years agoBug 3449: pt3: shm_open can fail with a mangled path
Amos Jeffries [Tue, 17 Jan 2012 08:41:18 +0000 (01:41 -0700)] 
Bug 3449: pt3: shm_open can fail with a mangled path

13 years agoSourceLayout: DNS component code style changes
Amos Jeffries [Tue, 17 Jan 2012 08:38:32 +0000 (01:38 -0700)] 
SourceLayout: DNS component code style changes

- removes "dnsserver" terminology from all the Squid internals and
  ./configure docs. Replacing it with "helper" to avoid confusion.

- updates the automake conditional to ENABLE_DNSHELPER and code define
  to USE_DNSHELPER inline with coding guidelines.

- shuffles the DNS API definitions to their own header, SquidDns.h, and
  de-duplicates the init/shutdown API calls to remove some #if

13 years agoCleanup: unlinkd is self-contained
Amos Jeffries [Tue, 17 Jan 2012 08:34:49 +0000 (01:34 -0700)] 
Cleanup: unlinkd is self-contained

This helper is very minimal. It does not use IP:: or Ipc:: symbols.
If we get linkage issues against it for them those need to be resolved
without pulling in dependencies from squid internal libraries.

13 years agoCleanup: detatch diskd from squid.h
Amos Jeffries [Tue, 17 Jan 2012 08:32:07 +0000 (01:32 -0700)] 
Cleanup: detatch diskd from squid.h

13 years agoSourceLayout: shuffle UserRequest into Auth:: namespace
Amos Jeffries [Sat, 7 Jan 2012 06:05:46 +0000 (23:05 -0700)] 
SourceLayout: shuffle UserRequest into Auth:: namespace

No logic changes, symbols and debug only.

* shuffle AuthUserRequest to Auth::UserRequest
* shuffle AuthBasicUserRequest to Auth::Basic::UserRequest
* shuffle AuthDigestUserRequest to Auth::Digest::UserRequest
* shuffle AuthNegotiateUserRequest to Auth::Negotiate::UserRequest
* shuffle AuthNTLMUserRequest to Auth::NTLM::UserRequest

* polish and add documentation for several parts of the hierarchy

* replace obsolete debugs() location texts

13 years agoPolish: allow service of internal requests over reverse-proxy ports
Amos Jeffries [Sat, 7 Jan 2012 06:00:11 +0000 (23:00 -0700)] 
Polish: allow service of internal requests over reverse-proxy ports

There is no reason why a revers-proxy port cannot service Squid internal
requests as well as whatever domain is being accelerated.

Also, scan the https_port list same as http_port list now that the
structures have been normalized.

13 years agoCleanup: de-duplicate internal URL detection
Amos Jeffries [Sat, 7 Jan 2012 05:58:20 +0000 (22:58 -0700)] 
Cleanup: de-duplicate internal URL detection

13 years agoBug 3461: build regression in IPFilter NAT
Amos Jeffries [Sat, 7 Jan 2012 05:49:19 +0000 (22:49 -0700)] 
Bug 3461: build regression in IPFilter NAT

13 years agoBug 3470: GCC 4.7
Amos Jeffries [Sat, 7 Jan 2012 05:43:45 +0000 (22:43 -0700)] 
Bug 3470: GCC 4.7

13 years agoBug 3370: external ACL sometimes skipping
Amos Jeffries [Thu, 22 Dec 2011 07:34:08 +0000 (00:34 -0700)] 
Bug 3370: external ACL sometimes skipping

Emit tag/user/log/message/pass details to the request in the case where
the external ACL entry has expired but within graceful revalidate period.

The result of this bug appears as incorrect matches later down the ACL
processing in any config relying on the external ACL output values.
Example; for bypassing auth login, or for filtering tagged traffic.

13 years agoPolish: better debugs for IPFilter NAT
Amos Jeffries [Thu, 22 Dec 2011 07:31:30 +0000 (00:31 -0700)] 
Polish: better debugs for IPFilter NAT

13 years agoBug 3447: assertion failed: CommCalls.h:150: "dp"
Amos Jeffries [Thu, 22 Dec 2011 07:30:04 +0000 (00:30 -0700)] 
Bug 3447: assertion failed: CommCalls.h:150: "dp"

Detatch FD/connection close handlers from reliance on commCloseCbParams
some handlers use FdeCbParams and others are possible.

If the callback handler needs FD the call creator must save it in the
params at call construction time.

13 years agoCleanup: remove https_port_list type
Amos Jeffries [Thu, 22 Dec 2011 07:29:00 +0000 (00:29 -0700)] 
Cleanup: remove https_port_list type

* Complete the merger with http_port_list and remove the https-specific struct

* kept config file type for parser magics and backward compatibility

13 years agoCleanup: comm Timeout API
Amos Jeffries [Thu, 22 Dec 2011 07:26:50 +0000 (00:26 -0700)] 
Cleanup: comm Timeout API

* accept Comm::Connection when setting timeout
 - use commSetConnTimeout() now

* drop old cbdata wrapper function

* drop raw-FD timeout setting (unused)

13 years agoBug 3391: forwarded_for log functionality broken
Amos Jeffries [Thu, 22 Dec 2011 07:25:54 +0000 (00:25 -0700)] 
Bug 3391: forwarded_for log functionality broken

13 years agoBug 3413: raise cbdata lock limits
Amos Jeffries [Thu, 22 Dec 2011 07:23:50 +0000 (00:23 -0700)] 
Bug 3413: raise cbdata lock limits

In 3.2 it is now possible to have >64K simultaneous connections
referencing some permanent cbdata locked state (port, peer, acl etc)

13 years agoBug 2519: ssl_bump + Authentication (LDAP Digest) issues
Christos Tsantilas [Thu, 22 Dec 2011 07:22:38 +0000 (00:22 -0700)] 
Bug 2519: ssl_bump + Authentication (LDAP Digest) issues

When the ssl_bump and authentication iare both enabled for an ssl-bumped port
all SSL enabled websites prompt the user for authentication information once
per FQDN.

This patch inherits the authentication info from the CONNECT request to the
sslbumped requests.

13 years agoBug 3448: 204 response problem in adaptation chains
Christos Tsantilas [Thu, 22 Dec 2011 07:19:32 +0000 (00:19 -0700)] 
Bug 3448: 204 response problem in adaptation chains

When the first ICAP service in a chain respond with 204 the next service
is aborted on Must(old_request->canonical) expression inside Adaptation::Icap::ModXact::encapsulateHead method.

Squid ICAP try to set the request::canonical member of the adapted request
inside Adaptation::Icap::ModXact::prepEchoing when the 204 response received.
The adapted.header->parse(..) call some lines after will set canonical member
to NULL.

This patch calls the urlCanonical() function after parse() method
to build canonical member for the adapted request, instead of trying to copy
this member from the original request.

13 years ago3.2.0.14 SQUID_3_2_0_14
Amos Jeffries [Mon, 12 Dec 2011 10:37:58 +0000 (03:37 -0700)] 
3.2.0.14

13 years agoCleanup: MemBufs don't need explicit cleanup anymore in HttpBody
Francesco Chemolli [Mon, 12 Dec 2011 10:35:42 +0000 (03:35 -0700)] 
Cleanup: MemBufs don't need explicit cleanup anymore in HttpBody

13 years agoCleanup: Removed dead HttpHeaderExtField code
Francesco Chemolli [Mon, 12 Dec 2011 10:35:06 +0000 (03:35 -0700)] 
Cleanup: Removed dead HttpHeaderExtField code

13 years agoLanguage Updates
Various Translators [Mon, 12 Dec 2011 09:56:55 +0000 (02:56 -0700)] 
Language Updates

13 years agoSourceLayout: C++ refactor FileMap
Francesco Chemolli [Thu, 8 Dec 2011 11:00:12 +0000 (04:00 -0700)] 
SourceLayout: C++ refactor FileMap

13 years agoPolish: correct debug text about ACL 'AND' list match state
Amos Jeffries [Thu, 8 Dec 2011 10:59:07 +0000 (03:59 -0700)] 
Polish: correct debug text about ACL 'AND' list match state

13 years agoDocs: mention ssl_crtd DB needs clearing after CA changes.
Amos Jeffries [Thu, 8 Dec 2011 10:58:42 +0000 (03:58 -0700)] 
Docs: mention ssl_crtd DB needs clearing after CA changes.

13 years agoBug 3420: Request body consumption races and !theConsumer exception.
Alex Rousskov [Thu, 8 Dec 2011 10:57:39 +0000 (03:57 -0700)] 
Bug 3420: Request body consumption races and !theConsumer exception.

Also fixes endless waiting for HTTP client to send req body we no longer need.

Before these changes, the client side used a single "closing" state to
handle two different error conditions:

  1. We stopped receiving request body because of some error.
  2. We stopped sending response because of some error.

When a "directional" error occurred, we try to keep the transaction going in
the other direction (e.g., to give ICAP the entire request or to give HTTP
client the entire response). However, because there was just one "closing"
state, the code failed to correctly detect or process many corner cases,
resulting in stuck transactions and !theConsumer assertions/exceptions due to
races between enableAutoConsumption() and expectNoConsumption() calls.

This patch replaces the "closing" state with two direction-specific "we
stopped sending/receiving" flags.

Now, when the response sending code is done, it now checks whether the
receiving code stopped and closes the connection as needed. This is done both
when we encounter a sending error (ClientSocketContext::initiateClose) and
when we successfully sent the entire response to the client
(ClientSocketContext::keepaliveNextRequest).

Similarly, when the request body reading code is done, it now checks whether
the receiving code stopped and closes the connection as needed. This is done
both when we encounter a receiving error
(ConnStateData::noteBodyConsumerAborted) and when we successfully receive the
entire request body from the client (ClientSocketContext::writeComplete).

TODO: This patch focuses on various error cases. We might still have problems
when there is an early HTTP response and no errors of any kind. I marked the
corresponding old code with an XXX.

13 years agoSourceLayout: c++ refactor HttpBody
Francesco Chemolli [Thu, 8 Dec 2011 10:56:24 +0000 (03:56 -0700)] 
SourceLayout: c++ refactor HttpBody

13 years agoBug 3442: assertion failed: external_acl.cc:908: ch->auth_user_request != NULL
Amos Jeffries [Thu, 8 Dec 2011 10:53:31 +0000 (03:53 -0700)] 
Bug 3442: assertion failed: external_acl.cc:908: ch->auth_user_request != NULL

External ACL sometimes cannot find the credentials in ACL Checklist even
if they are attached to the HTTPRequest object.

This seems to happen when the checklist is created and the line match
started before the credentials are known. The credentials validation
updates the HTTP request state but is not aware of ACL checklists needing
to be updated so it never happens.

This patch:
* locate the %LOGIN value from either place where credentials can be found,
* updates the checklist if it was unset,
* passes '-' to the helper if no credentials at all were given.

Although the earlier logics forcing a lookup means this '-' case should
not happen it might if the external ACL were processed in 'fast' check.

13 years agoAdd FdeCbParams parameter object to CommCalls API.
Amos Jeffries [Thu, 8 Dec 2011 10:51:09 +0000 (03:51 -0700)] 
Add FdeCbParams parameter object to CommCalls API.

The problem:
  CommCalls API functionality is conflated with comm operational calls
created to do general FD handling (FD as pipe handle, FD as disk handle,
FD as pointer into the fd_table structure). Sometimes because they do
operations mirroring comm handlers and also use FD.  None of this actually
requires the CommCalls layer to be involved though. The Comm::Connection
objects which CommCall TCP handlers pass around is also very inappropriate
for these FD types.

This adds FdeCbParams to CommCalls infrastructure, for use internally and
"lower" than comm API to pass around raw FD values. This should be avoided
on TCP socket FD, but may be used by callers needing FD where
Comm::Connection is inappropriate.

13 years agoCBDATA call Dialer template
Amos Jeffries [Thu, 8 Dec 2011 10:49:51 +0000 (03:49 -0700)] 
CBDATA call Dialer template

This adds a template for dialing Unary CBDATA wrapper functions with
type safety. Avoiding the casting that currently occurs in wrappers and
allowing the AsyncCall APIs to be used for these callbacks.

13 years agoPolish: debug messages on swap.state rename failure
Amos Jeffries [Thu, 8 Dec 2011 10:42:54 +0000 (03:42 -0700)] 
Polish: debug messages on swap.state rename failure

13 years agoSourceLayout: Surrogate-Control c++ refactoring
Francesco Chemolli [Thu, 8 Dec 2011 10:41:42 +0000 (03:41 -0700)] 
SourceLayout: Surrogate-Control c++ refactoring

13 years agoCleanup: Removed now useless -fhuge-objects GCC compiler flag
Francesco Chemolli [Thu, 8 Dec 2011 10:39:26 +0000 (03:39 -0700)] 
Cleanup: Removed now useless -fhuge-objects GCC compiler flag

13 years agoDocument registered HTTP headers with why they are registered
Amos Jeffries [Thu, 8 Dec 2011 10:38:24 +0000 (03:38 -0700)] 
Document registered HTTP headers with why they are registered

13 years agoPrep for 3.1.18
Amos Jeffries [Sat, 3 Dec 2011 06:00:11 +0000 (23:00 -0700)] 
Prep for 3.1.18

13 years agoPrep for 3.1.17 and other documentation updates
Amos Jeffries [Fri, 2 Dec 2011 14:07:48 +0000 (07:07 -0700)] 
Prep for 3.1.17 and other documentation updates

13 years agoCleanup: remove useless typedefs
Francesco Chemolli [Fri, 2 Dec 2011 08:18:22 +0000 (01:18 -0700)] 
Cleanup: remove useless typedefs

13 years agoBug 3422: Buffer overflow in recv-announce
Jan Klemkow [Fri, 2 Dec 2011 08:16:56 +0000 (01:16 -0700)] 
Bug 3422: Buffer overflow in recv-announce

13 years agoBug 3428: Active FTP data channel accepted twice
Michael Weiser [Fri, 2 Dec 2011 08:15:33 +0000 (01:15 -0700)] 
Bug 3428: Active FTP data channel accepted twice

13 years agoBug 3433: Segfault closing SNMP
Amos Jeffries [Fri, 2 Dec 2011 08:14:32 +0000 (01:14 -0700)] 
Bug 3433: Segfault closing SNMP

13 years agoBug 3432: Crash logging FTP errors
yabuki [Fri, 2 Dec 2011 08:13:44 +0000 (01:13 -0700)] 
Bug 3432: Crash logging FTP errors

13 years agoSourceLayout: ErrorState constructor/destructor
Amos Jeffries [Tue, 29 Nov 2011 06:52:23 +0000 (23:52 -0700)] 
SourceLayout: ErrorState constructor/destructor

13 years agoBug 3301: ERR_DNS_FAIL never shown
Amos Jeffries [Tue, 29 Nov 2011 06:48:59 +0000 (23:48 -0700)] 
Bug 3301: ERR_DNS_FAIL never shown

13 years agoBug 3430: Document SSL EDH cipher configuration issues
Amos Jeffries [Tue, 29 Nov 2011 06:26:16 +0000 (23:26 -0700)] 
Bug 3430: Document SSL EDH cipher configuration issues

13 years agoCorrect libxml2 include path search when using a configure cache
Henrik Nordstrom [Tue, 29 Nov 2011 06:25:15 +0000 (23:25 -0700)] 
Correct libxml2 include path search when using a configure cache

13 years agoWindows: cf_gen requires a .exe extension
Amos Jeffries [Tue, 29 Nov 2011 06:23:40 +0000 (23:23 -0700)] 
Windows: cf_gen requires a .exe extension

13 years agoPortability: fix radix.c include sequence
Amos Jeffries [Tue, 29 Nov 2011 06:21:42 +0000 (23:21 -0700)] 
Portability: fix radix.c include sequence

13 years agoCleanup: remove defined() from compat OS macros
Amos Jeffries [Tue, 29 Nov 2011 06:20:26 +0000 (23:20 -0700)] 
Cleanup: remove defined() from compat OS macros

13 years agoPortability: log_file_daemon compile dependencies
Amos Jeffries [Tue, 29 Nov 2011 06:19:03 +0000 (23:19 -0700)] 
Portability: log_file_daemon compile dependencies

13 years agoWindows: basic_sspi_auth compile dependencies
Amos Jeffries [Tue, 29 Nov 2011 06:18:29 +0000 (23:18 -0700)] 
Windows: basic_sspi_auth compile dependencies

13 years agoWindows: basic_smb_auth compile dependencies
Amos Jeffries [Tue, 29 Nov 2011 06:17:51 +0000 (23:17 -0700)] 
Windows: basic_smb_auth compile dependencies

13 years agoFix segfault in %F error page token
Amos Jeffries [Tue, 29 Nov 2011 06:15:31 +0000 (23:15 -0700)] 
Fix segfault in %F error page token

13 years agoBug 3366: assertion comm.cc:1276: isOpen(fd) via CompositePoolNode::kickReads
Amos Jeffries [Thu, 24 Nov 2011 11:57:59 +0000 (04:57 -0700)] 
Bug 3366: assertion comm.cc:1276: isOpen(fd) via CompositePoolNode::kickReads

Check Deferred read FD is still active before re-scheduling the read.

13 years agoFix: HttpRequest flags intercepted, spoof_client_ip never set correctly
Christos Tsantilas [Thu, 24 Nov 2011 07:06:10 +0000 (00:06 -0700)] 
Fix: HttpRequest flags intercepted, spoof_client_ip never set correctly

The request_flags::intercepted,request_flags::spoof_client_ip are 1 bit integers
so when you are try to set to an integer bigger than 1 will overflow and the
results will not be what you are expecting.

13 years agoPolish: convert one SECURITY WARNING to ALERT
Amos Jeffries [Thu, 24 Nov 2011 07:04:58 +0000 (00:04 -0700)] 
Polish: convert one SECURITY WARNING to ALERT

13 years agoBug 3377: assertion failed: store.cc:885: "store_status == STORE_PENDING"
Alex Rousskov [Thu, 24 Nov 2011 07:03:55 +0000 (00:03 -0700)] 
Bug 3377: assertion failed: store.cc:885: "store_status == STORE_PENDING"

The StoreEntry::write in the case of an empty write, calls the StoreEntry
handlers. It is possible one of these handlers will change the state of the
store entry or abort it. The next call of the StoreEntry::write will cause
this assertion.

The block of code which calls the StoreSntry handlers in the case of an empty
write, added to allow forward http headers to the client even if no body data
arrived yet (bug 1750). There is not need for this part of code in the latest
squid releases, so it is safe to be removed.

13 years agoAvoid crashes when processing bad X509 common names (CN).
Alex Rousskov [Thu, 24 Nov 2011 07:03:00 +0000 (00:03 -0700)] 
Avoid crashes when processing bad X509 common names (CN).

X509_REQ_get_pubkey() returns a refcounted object that we must clean after use.
X509_REQ_get_subject_name() does not; cleaning the result may cause segfaults.
How we are supposed to tell the difference is beyond me.

13 years agoCleanup: comm Close handlers
Amos Jeffries [Thu, 24 Nov 2011 07:01:41 +0000 (00:01 -0700)] 
Cleanup: comm Close handlers

Make handlers take the CommCloseCbParams instead of series of expanded
variables.

Opening access to the other CommCommonCbParams fields with Connection/FD
data. Hiding the deprecated FD parameter from most handlers. Which seem
not to have actually needed it in most cases outside Comm.

13 years agoCleanup: comm IOACB handlers
Amos Jeffries [Thu, 24 Nov 2011 07:00:42 +0000 (00:00 -0700)] 
Cleanup: comm IOACB handlers

Make handlers take the CommAcceptCbParams instead of series of expanded
variables. Removing listening fd parameter which was not used anyway.

13 years agoCleanup: IsConnOpen checks for NULL
Amos Jeffries [Thu, 24 Nov 2011 06:59:46 +0000 (23:59 -0700)] 
Cleanup: IsConnOpen checks for NULL

13 years agoBug 2619: Excessive RAM growth due to unlimited adapted body data consumption
Martin Huter [Thu, 24 Nov 2011 06:37:32 +0000 (23:37 -0700)] 
Bug 2619: Excessive RAM growth due to unlimited adapted body data consumption

If the client does not read from the open connection (i.e. the user does not
confirm the browsers download-message-box in microsofts IE), squid keeps on
reading data from the ICAP server into the store entry, while no more data
can be delivered to the client.
Thus the store entry in memory is growing and squid may - in worst case -
consume memory up to the size of the users download.

This patch add API to StoreEntry to call the producer back when released
memory/space from the StoreEntry and add code to the ICAP client code to not
consume body data comes from the ICAP server when there is not available space
in the store entry.

13 years agoFill access log %error_detail when responding with ERR_SECURE_CONNECT_FAIL.
Christos Tsantilas [Thu, 24 Nov 2011 06:16:15 +0000 (23:16 -0700)] 
Fill access log %error_detail when responding with ERR_SECURE_CONNECT_FAIL.

This is a Measurement Factory project

13 years agoBug 3423: access violation in URL parser
Jan Klemkow [Thu, 24 Nov 2011 06:15:23 +0000 (23:15 -0700)] 
Bug 3423: access violation in URL parser

13 years agoLog Format token namespace upgrade
Amos Jeffries [Thu, 24 Nov 2011 06:13:51 +0000 (23:13 -0700)] 
Log Format token namespace upgrade

This updates the format parser and storage objects in the Format::
namespace and separates some into separate files.

Add a registration API so components can register themselves an array
of tokens in a namespace. Registering the arbitrary namespace "example"
with some tokens ("a","b") will cause the parser to accept those tokens
in a logging format like so: "%example::a %example::b".

Future work:
 - use runners registry instead of Init() function
 - convert the error pages to use format for the page body macros
 - convert the %ssl_* tokens in src/ssl/* to use format and "ssl::"
 - convert external_acl_type to use formats for its helper input string.

13 years agoUse the right certificate when detailing SSL certificate validation errors.
Mathias Fischer [Thu, 24 Nov 2011 06:12:49 +0000 (23:12 -0700)] 
Use the right certificate when detailing SSL certificate validation errors.

When an _intermediate_ SSL server certificate fails validation, we should
report errors using information in that certificate and not in the top-level
"peer" certificate. Otherwise, our details may make no sense. For example, we
may say that the validation failed due to the expired certificate and then show
an expiration date in the future (because the top-level certificate did not
expire but the intermediate certificate did).

OpenSSL X509_STORE_CTX_get_current_cert() returns the certificate that was
being tested when our certificate validation callback was called.

13 years agoSupport %% in external ACL format
Amos Jeffries [Thu, 24 Nov 2011 06:11:55 +0000 (23:11 -0700)] 
Support %% in external ACL format

13 years agoFix Comm::Write closing() assertion when retrying a failed UDP DNS query.
Alex Rousskov [Thu, 17 Nov 2011 09:34:09 +0000 (02:34 -0700)] 
Fix Comm::Write closing() assertion when retrying a failed UDP DNS query.

When we receive a UDP DNS response with a truncation (TC) bit set, we retry
using TCP. Since the retry trigger has nothing to do with the TCP connection,
it is possible that the TCP connection is being closed when we are about to
write to it: A call to our connection close callback has been scheduled but
has not fired yet. We must check for and avoid such race conditions.

13 years agoBug 2910: MemBuf may grow beyond max_capacity
Alex Rousskov [Thu, 17 Nov 2011 09:32:56 +0000 (02:32 -0700)] 
Bug 2910: MemBuf may grow beyond max_capacity

13 years agoBug 3412: External ACL Uses Invalid Cache Entry
Amos Jeffries [Thu, 17 Nov 2011 09:31:55 +0000 (02:31 -0700)] 
Bug 3412: External ACL Uses Invalid Cache Entry

13 years agoBug 3398: persistent server connection closed after PUT/DELETE
Christos Tsantilas [Thu, 17 Nov 2011 09:30:58 +0000 (02:30 -0700)] 
Bug 3398: persistent server connection closed after PUT/DELETE

13 years agoFix assertion when dstdomain abused in access controls
Amos Jeffries [Thu, 17 Nov 2011 09:29:43 +0000 (02:29 -0700)] 
Fix assertion when dstdomain abused in access controls

This converts an assertion into a logged warning and a failed-match if
dstdomain ACLs are used in places where the HTTP request is not available.

13 years agoBug 3408: Wrong header length leads to EFAULTs when cretating UFS swap.log.new.
Matthias Pitzl [Thu, 17 Nov 2011 09:28:26 +0000 (02:28 -0700)] 
Bug 3408: Wrong header length leads to EFAULTs when cretating UFS swap.log.new.

Also localized the header variable as it may be destroyed at any time.

13 years agoDocument and alter the pconn idle timeout directives.
Amos Jeffries [Thu, 17 Nov 2011 09:26:50 +0000 (02:26 -0700)] 
Document and alter the pconn idle timeout directives.

Alters the directive names to clarify what they do and adds some more
description to the config file documentation.

Alters the internal config variables to match the new directive names.

Also alters the well known messages in mgr:filedescriptors report a little
to indicate client/server type and adds a standard "Idle " prefix for
easy automated scanning.

13 years agoDetail SSL handshake failures
Christos Tsantilas [Thu, 17 Nov 2011 09:25:54 +0000 (02:25 -0700)] 
Detail SSL handshake failures

This patch allows Squid to provide details for the %D macro on the secure
connect failed error page when an SSL handshake with the origin server fails.
The default %D text is "Handshake with SSL server failed: XYZ" where XYZ is the
corresponding error string/description returned by OpenSSL if there is any.

This is a Measurement Factory project.

13 years agoAdd a mask on the qos_flows miss configuration value.
Andrew Beverley [Sun, 6 Nov 2011 01:38:17 +0000 (19:38 -0600)] 
Add a mask on the qos_flows miss configuration value.

The reason for this is to allow the preserved mark/TOS value from the
server to be altered slightly rather than overwritten completely.

Example usage. The following will preserve the netfilter mark, but will
ensure that the (9th) bit specified in the miss value will be set to 1
in the preserved mark:

  qos_flows mark miss=0x100/0xF00