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

13 years agoBug 3299: dnsserver: various undefined references
Amos Jeffries [Sun, 6 Nov 2011 01:32:20 +0000 (19:32 -0600)] 
Bug 3299: dnsserver: various undefined references

13 years agoPortability: add cstdarg as source of var_arg when available
Amos Jeffries [Sun, 6 Nov 2011 01:30:58 +0000 (19:30 -0600)] 
Portability: add cstdarg as source of var_arg when available

13 years agoPolished calculation of the number of needed memory pages for one Store write.
Alex Rousskov [Sun, 6 Nov 2011 01:30:04 +0000 (19:30 -0600)] 
Polished calculation of the number of needed memory pages for one Store write.

The old code was overestimating the number of memory pages required when we
needed to write exactly n*SM_PAGE_SIZE bytes.

13 years agoBug 3364: SNMP Orphans
Amos Jeffries [Sun, 6 Nov 2011 01:28:36 +0000 (19:28 -0600)] 
Bug 3364: SNMP Orphans

13 years agoBug 3406: SSL Log Error in debug
Amos Jeffries [Sun, 6 Nov 2011 01:27:52 +0000 (19:27 -0600)] 
Bug 3406: SSL Log Error in debug

13 years agoFixed two more cases of outdated shared memory cache detection
Amos Jeffries [Sun, 6 Nov 2011 00:03:50 +0000 (18:03 -0600)] 
Fixed two more cases of outdated shared memory cache detection

... which led to "STORE_DISK_CLIENT == getType()" assertions
when running SMP Squid with non-shared memory caching.

UsingSmp() is not the right condition to detect whether we are using a shared
memory cache because shared memory caching may be disabled and because
Coordinator does not use a shared memory cache even if shared caching is
enabled.

See also bug 3383

13 years agoSource Maintenance: Optimizations and macro fixes
Amos Jeffries [Sun, 6 Nov 2011 00:02:23 +0000 (18:02 -0600)] 
Source Maintenance: Optimizations and macro fixes

* optimize the maintenance script to only scan for macro problems once

* fix some file macro wrappers not to clash with the OS-macro naming scheme

* fix macro ifdef/ifndef on feature presence macros to use defined() instead

13 years agoBug 3367: fix inverted check on host_strict_verify
Amos Jeffries [Fri, 4 Nov 2011 23:31:04 +0000 (17:31 -0600)] 
Bug 3367: fix inverted check on host_strict_verify

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 29 Oct 2011 22:45:17 +0000 (16:45 -0600)] 
SourceFormat Enforcement

13 years agoAdd adaptation_meta option
Christos Tsantilas [Sat, 29 Oct 2011 12:05:39 +0000 (06:05 -0600)] 
Add adaptation_meta option

This option allows Squid administrator to add custom ICAP request
headers or eCAP options to Squid ICAP requests or eCAP transactions.
Use it to pass custom authentication tokens and other
transaction-state related meta information to an ICAP/eCAP service.

The addition of a meta header is ACL-driven:
        adaptation_meta name value [!]aclname ...

Processing for a given header name stops after the first ACL list match.
Thus, it is impossible to add two headers with the same name. If no ACL
lists match for a given header name, no such header is added. For example:

        # do not debug transactions except for those that need debugging
        adaptation_meta X-Debug 1 needs_debugging

        # log all transactions except for those that must remain secret
        adaptation_meta X-Log 1 !keep_secret

        # mark transactions from users in the "G 1" group
        adaptation_meta X-Authenticated-Groups "G 1" authed_as_G1

The "value" parameter may be a regular squid.conf token or a "double
quoted string". Within the quoted string, use backslash (\) to escape
any character, which is currently only useful for escaping backslashes
and double quotes. For example,
    "this string has one backslash (\\) and two \"quotes\""

This is a Measurement Factory project

13 years agoFix "int to double" compiler warnings in IpcIoClaimMemoryNeedsRr::run().
Dmitry Kurochkin [Sat, 29 Oct 2011 11:50:55 +0000 (05:50 -0600)] 
Fix "int to double" compiler warnings in IpcIoClaimMemoryNeedsRr::run().

13 years agoProvide "fake" AtomicWordT implementation for non-SMP configurations.
Dmitry Kurochkin [Sat, 29 Oct 2011 11:49:34 +0000 (05:49 -0600)] 
Provide "fake" AtomicWordT implementation for non-SMP configurations.

While we can not provide real AtomicWordT implementation on the systems where
atomic operations are not available, we can use a "fake" one if Squid is
running in non-SMP mode.  Before the change, the "fake" implementation was
always asserting, which is too restrictive and leads to test failures on
systems without atomic operations.

The new implementation works under conditions similar to "fake" shared memory
segments and allows SMP-using code (e.g. Rock store) to work in non-SMP mode.
In particular, it allows tests to pass on such systems.

AtomicWordT was renamed to WordT and moved to Ipc::Atomic namespace to allow
Ipc::Atomic::Enabled() to be declared outside of the AtomicWordT template
class.  This lets us define the Enabled() method in AtomicWord.cc which avoids
dragging protos.h #include into the AtomicWord.h header.

13 years agoBug 3150: do not start useless unlinkd.
Dmitry Kurochkin [Sat, 29 Oct 2011 11:47:24 +0000 (05:47 -0600)] 
Bug 3150: do not start useless unlinkd.

Unlinkd may be used only by UFS storage but, before the change, Squid
always started unlinkd if it was built, even if it was not needed.

Whether a SwapDir may use unlinkd depends on the SwapDir
implementation and DiskIO strategy it uses.  The patch adds
unlinkdUseful() method to SwapDir and DiskIOStrategy to decide if
unlinkd should be started.

After the change, unlinkd may be started during reconfiguration and
unlinkdInit() may be called multiple times.

After the change, unlinkdClose() may be called when unlinkd was never
started.  The patch removes a warning which was printed in this case
on Windows.

13 years agoOptimization: Make read requests in [Rock] IpcIo bypass max-swap-rate limit.
Dmitry Kurochkin [Sat, 29 Oct 2011 11:46:10 +0000 (05:46 -0600)] 
Optimization: Make read requests in [Rock] IpcIo bypass max-swap-rate limit.

Before the change, IpcIoFile::WaitBeforePop() delayed both swap ins
(hits) and swap outs (misses).  This is suboptimal because reads do
not usually accumulate unfinished I/O requests in OS buffers and,
hence, do not eventually require the OS to block all I/O.

Ideally, a disker should probably dequeue all pending disker requests,
satisfy reads ASAP, and then handle writes, but that is difficult for
several reasons.  The patch implements a simpler approach: peek the
next request to be popped, and if it is a swap in (i.e., read or hit),
then pop it without any delay.

When a read is popped, we still adjust the balance member and LastIo,
because we do want to maintain the configured average I/O rate. When a
write request comes in, it will be delayed [longer] if needed.

In the extreme case of a very long stream of read requests (no writes
at all), there will be essentially no I/O rate limit and that is what
we want.

13 years agoDo not allow max-swap-rate and swap-timeout reconfiguration for Rock Store.
Dmitry Kurochkin [Sat, 29 Oct 2011 11:43:41 +0000 (05:43 -0600)] 
Do not allow max-swap-rate and swap-timeout reconfiguration for Rock Store.

These options are used to configure DiskIO module during Rock SwapDir
initialization.  During reconfiguration, the values are updated in Rock
SwapDir, but they do not reach the DiskIO module.  Thus, while Squid says that
option has a new value, the new value is never really used.  This patch fixes
this inconsistency.

In the future, we may support reconfiguration for max-swap-rate and
swap-timeout, but that would require adding reconfiguration support
to DiskIO modules.

13 years agoRename Ipc::FewToFewBiQueue method peek() to findOldest()
Alex Rousskov [Sat, 29 Oct 2011 11:42:50 +0000 (05:42 -0600)] 
Rename Ipc::FewToFewBiQueue method peek() to findOldest()

to better match the method functionality.

13 years agoIndependent shared I/O page limit.
Dmitry Kurochkin [Sat, 29 Oct 2011 11:41:43 +0000 (05:41 -0600)] 
Independent shared I/O page limit.

Shared memory pages are used for shared memory cache and IPC I/O module.
Before this change, the number of shared memory pages needed for IPC I/O
was calculated from the size of shared memory cache.  Moreover, shared
memory cache was required for IPC I/O.

The patch makes the limit for shared I/O pages independent from the
shared memory cache size and presence.  IPC I/O pages limit is calculated
from the number of workers and diskers; it does not depend on cache_dir
configuration.  This may change in the future if we learn how to compute
it (e.g., by multiplying max-swap-rate and swap-timeout if both are
available).