]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
14 years agoAdded disk_io_timeout to squid.conf to control approximately how long Squid take07
Alex Rousskov [Thu, 4 Aug 2011 07:18:25 +0000 (01:18 -0600)] 
Added disk_io_timeout to squid.conf to control approximately how long Squid
allowsDisconnecting: Timeout, server not responding. queuing time. If the
anticipated I/O time exceeds the configured limit, Squid will not swap the
corresponding object in or out, allowing for the disk queues to drain.

14 years agoBug 3159: delay pools --disable-auth compile problems
Alex Rousskov [Wed, 3 Aug 2011 20:44:38 +0000 (14:44 -0600)] 
Bug 3159: delay pools --disable-auth compile problems

Also adds test-suite scan for --disable-auth issues.

Cherry-picked from trunk (r11472).

14 years agoAlways call processReplyBody() after adaptOrFinalizeReply().
Dmitry Kurochkin [Wed, 29 Jun 2011 05:59:07 +0000 (09:59 +0400)] 
Always call processReplyBody() after adaptOrFinalizeReply().

The recent fix for "store_status == STORE_PENDING" added a check
with return from HttpStateData::processReply() before
processReplyBody() call.  But processReplyBody() does proper
server state cleanup.  We could end up with server state that
would not be cleaned (until connection is closed).  That could
also introduce other issues.  The patch moves the isAccepting()
check from processReply() to processReplyBody().  We do not write
to an entry that is not accepting, but allow processReplyBody()
to do proper cleanup.

14 years agoFix GCC v4.6.1 "variable set but not used" warnings.
Dmitry Kurochkin [Wed, 29 Jun 2011 03:58:58 +0000 (07:58 +0400)] 
Fix GCC v4.6.1 "variable set but not used" warnings.

14 years agoFix crash in IpcIoFile::readCompleted() when response is NULL.
Dmitry Kurochkin [Mon, 27 Jun 2011 21:16:45 +0000 (01:16 +0400)] 
Fix crash in IpcIoFile::readCompleted() when response is NULL.

14 years agoSeparate shared page limits for different purposes.
Dmitry Kurochkin [Mon, 27 Jun 2011 20:58:29 +0000 (00:58 +0400)] 
Separate shared page limits for different purposes.

The patch implements separate level counters for shared pages
with different purpose (i.e. memory cache and IPC I/O).  A new
purpose parameter was added to Ipc::Mem::GetPage() function to
update the level and check the limits.  After the change, memory
cache and IPC I/O limits are separate and do not affect each
other, i.e. full memory cache does not eat all IPC I/O pages.

14 years agoPolished I/O spelling.
Alex Rousskov [Fri, 24 Jun 2011 15:51:16 +0000 (09:51 -0600)] 
Polished I/O spelling.

14 years agoPrettify HttpStateData::processReply() code a bit by moving a comment up.
Dmitry Kurochkin [Fri, 24 Jun 2011 00:28:29 +0000 (04:28 +0400)] 
Prettify HttpStateData::processReply() code a bit by moving a comment up.

14 years agoFix assert in StoreEntry::write() when aborted entry is written.
Dmitry Kurochkin [Thu, 23 Jun 2011 23:35:43 +0000 (03:35 +0400)] 
Fix assert in StoreEntry::write() when aborted entry is written.

HttpStateData::processReply() calls adaptOrFinalizeReply(), which
calls ServerStateData::setFinalReply(), which calls
entry->startWriting(), which calls StoreEntry::invokeHandlers() which
calls client-side code, which may abort or otherwise "close" the
entry.

After adaptOrFinalizeReply() returns to HttpStateData::processReply(),
HttpStateData::processReply() calls HttpStateData::processReplyBody(),
which may try to write to the aborted/closed entry, leading to
asserts.

At least the following scenario triggers the bug:

* client send a regular GET for a cached stale object
* Squid sends an IMS verification request to the origin server
* the origin server replies with 304 (Not Modified)

In this case adaptOrFinalizeReply() in HttpStateData::processReply()
would abort the origin server reply entry, leading to assert.

The patch adds a checks that entry still can accept more data after
the adaptOrFinalizeReply() call.

14 years agoMore fixes for make check with some configure options.
Dmitry Kurochkin [Wed, 22 Jun 2011 23:13:09 +0000 (03:13 +0400)] 
More fixes for make check with some configure options.

14 years agoFix make check when Squid is configured with --enable-delay-pools.
Dmitry Kurochkin [Wed, 22 Jun 2011 02:36:36 +0000 (06:36 +0400)] 
Fix make check when Squid is configured with --enable-delay-pools.

14 years agoFix make check and make distcheck.
Dmitry Kurochkin [Tue, 21 Jun 2011 23:44:03 +0000 (03:44 +0400)] 
Fix make check and make distcheck.

Mostly makefile changes.  New stub code added and some unneeded
stub code removed.  Fixed for UFS and COSS tests related to
object destruction order.

14 years agoAdd shared memory page reserve for Rock and check page availability before IO.
Dmitry Kurochkin [Tue, 21 Jun 2011 14:35:48 +0000 (18:35 +0400)] 
Add shared memory page reserve for Rock and check page availability before IO.

The patch adds a shared memory page reserve for Rock (any IPC IO in
general) that can not be used by the memory cache.  Also, Rock checks
if there are free pages available before trying to do IPC IO (both
read and write).  This allows to fail early for cache reads and go
MISS route.

14 years agoDetect support for __sync_add_and_fetch() and friends,
Alex Rousskov [Wed, 25 May 2011 03:14:15 +0000 (21:14 -0600)] 
Detect support for __sync_add_and_fetch() and friends,
setting HAVE_ATOMIC_OPS accordingly.

Disable shared memory caching by default if atomic operations are not
supported. Prohibit shared memory caching if atomic operations are not
supported.

Needs more testing.

14 years agoFixed reporting whether mem_cache is shared.
Alex Rousskov [Wed, 25 May 2011 01:45:27 +0000 (19:45 -0600)] 
Fixed reporting whether mem_cache is shared.

TODO: That reporting code is misplaced and should be moved to MemStore.

14 years agoAdded memory_cache_shared to squid.conf. Report whether mem_cache is shared.
Alex Rousskov [Wed, 25 May 2011 00:33:52 +0000 (18:33 -0600)] 
Added memory_cache_shared to squid.conf. Report whether mem_cache is shared.

Allow the user to explicitly disable shared memory caching in SMP mode.

Added YesNoNone class to allow Squid to compute the default value of a boolean
option (based on other options) instead of using a hard-coded default. The
class is used to automatically enable shared memory caching in SMP
environments (and disable it in non-SMP environments) unless the user says
otherwise.

This needs more work to reduce the number of shared memory pages if shared
memory caching is disabled (the pages may still be needed for SMP I/O).

14 years agoMerged from parent (trunk r11446, v3.2.0.7+).
Alex Rousskov [Tue, 24 May 2011 22:26:21 +0000 (16:26 -0600)] 
Merged from parent (trunk r11446, v3.2.0.7+).

14 years agoLanguage: sl updates
Aleksa [Tue, 24 May 2011 12:02:38 +0000 (00:02 +1200)] 
Language: sl updates

14 years agoLanguage: fr updates
Bernard [Tue, 24 May 2011 06:02:09 +0000 (18:02 +1200)] 
Language: fr updates

14 years agoDocs: fancy up ERR_INVALID_REQ with some javascript
Amos Jeffries [Tue, 24 May 2011 05:33:47 +0000 (17:33 +1200)] 
Docs: fancy up ERR_INVALID_REQ with some javascript

Some of the "possible problems" can be determined as not-relevant.
When these cases are detected hide the text from viewers in a way that
keeps the page operational when javascript is disabled.

14 years agoBug 3122: Unknown record type in WCCPv2 Packet (6)
Amos Jeffries [Mon, 23 May 2011 03:13:58 +0000 (21:13 -0600)] 
Bug 3122: Unknown record type in WCCPv2 Packet (6)

14 years agoLanguage: fr added
Bernard [Mon, 23 May 2011 02:59:03 +0000 (14:59 +1200)] 
Language: fr added

14 years agoLanguage: sl updates
Aleksa Å uÅ¡uliÄ\87 [Mon, 23 May 2011 02:22:54 +0000 (14:22 +1200)] 
Language: sl updates

14 years agoDBG_IMPORTANT instead of DBG_WARNING
Amos Jeffries [Mon, 23 May 2011 01:49:35 +0000 (13:49 +1200)] 
DBG_IMPORTANT instead of DBG_WARNING

14 years agoURL re-writer handling bug fixes
Amos Jeffries [Sat, 21 May 2011 01:13:42 +0000 (13:13 +1200)] 
URL re-writer handling bug fixes

This patch includes two bug fixes in URL handling which were uncovered
during testing of the URL logging update:

* URL re-write handling was not correctly creating its adapted request
copy. The code here is much reduced by using the clone() method. Still
not completely satisfactory (marked with XXX) since on invalid URL
there is a wasted cycles cloning and deleting almost immediately.
Future cleanups moving the URL parts outside HttpRequest will fix that.

* URL parsing needs to set the canonical field to unset whenever the URI
is re-parsed into a request. This field is an optimization for later
display speed-ups. This has been causing incorrect canonical URL to be
used following re-write. When the cloning above was corrected it caused
asserts in the server-side.

* To prevent memory leaks the urnParse() function internal to URL parsing
is adjusted to accept and update an existing request in identical API
semantics to urlParse() instead of always generating a new one.

14 years agoDocs: display WARNING and ERROR when max_filedescriptors has failed.
Amos Jeffries [Fri, 20 May 2011 13:38:40 +0000 (01:38 +1200)] 
Docs: display WARNING and ERROR when max_filedescriptors has failed.

The big cases of missing OS dependencies and use of select() are mentioned
on configure parse where relevant. As well as from setMaxFD().

Failures to make the change are already logged, but now highlighted as
ERROR cases.

14 years agoFix assertion client_side_reply.cc:662: "r->clientConnectionManager == http->getConn()"
Amos Jeffries [Thu, 19 May 2011 12:02:58 +0000 (06:02 -0600)] 
Fix assertion client_side_reply.cc:662: "r->clientConnectionManager == http->getConn()"

TODO: There is a biger bug in the URL re-write cloning not being right in
general. That is getting a separate and much larger fix in a followup patch.

14 years agoCleanup: shuffle HttpRequest::inheritProperties next to clone()
Amos Jeffries [Wed, 18 May 2011 12:50:48 +0000 (00:50 +1200)] 
Cleanup: shuffle HttpRequest::inheritProperties next to clone()

Making it a bit easier to see exactly what fields are duplicated and which
are not.

14 years agoFix: correctly express libtool 2.2+ requirement.
Francesco Chemolli [Wed, 18 May 2011 11:33:23 +0000 (13:33 +0200)] 
Fix: correctly express libtool 2.2+ requirement.

14 years agoPortability fix: properly detect Iphlpapi.h on windows
Francesco Chemolli [Wed, 18 May 2011 01:03:37 +0000 (03:03 +0200)] 
Portability fix: properly detect Iphlpapi.h on windows

14 years agoRemoved useless assert.
Alex Rousskov [Sun, 15 May 2011 19:52:23 +0000 (13:52 -0600)] 
Removed useless assert.

14 years agoFix for "Separate SSL error detail name and message" patch
Christos Tsantilas [Sat, 14 May 2011 06:11:27 +0000 (09:11 +0300)] 
Fix for "Separate SSL error detail name and message" patch

Use "#if USE_SSL / #endif" for printing . Currently we have error details
only for SSL related errors.

14 years agoSeparate SSL error detail name and message
Christos Tsantilas [Fri, 13 May 2011 21:04:03 +0000 (00:04 +0300)] 
Separate SSL error detail name and message

Currently, SSL error detail in Squid-generated error pages (%D) contains
both the error name and the explanation text. Some folks using this feature
want to render the two pieces of information differently because the error
name is not something most end-users should read or focus on.

This patch adds the "%x" error page formating code which prints the error name,
and removes the error name (%err_name) from SSL error detail messages.

This is a Measurement Factory project

14 years agoAuthor: Alex Rousskov <rousskov@measurement-factory.com>
Christos Tsantilas [Fri, 13 May 2011 10:38:28 +0000 (13:38 +0300)] 
Author: Alex Rousskov <rousskov@measurement-factory.com>
Author: Alexey Veselovsky <alexey.veselovsky@eykontech.com>
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
Bug 2055: Honor ICAP Max-Connections

This patch implements the phase 1 of the ICAP Max-Connections feature as it is
described in squid wiki:
  http://wiki.squid-cache.org/Features/ServiceOverload

The behaviour of the patch  can be configured using on_overload and max_conn
options of the icap_service configuration parameter. Squid can be configured
to do one of the following:
  - Block: send and HTTP error response to the subscriber
  - Bypass: ignore the "over-connected" ICAP service
  - Wait: wait (in a FIFO queue) for an ICAP connection slot
  - Force: proceed, ignoring the Max-Connections limit

Squid warns the first time the service become overloaded

For more information please visit the feature wiki page given above.

Technical informations:

The patch starts count a connections to the ICAP server as active when the
ModXact class receives an FD even if the fd is not really connected to the
server yet, and decrease the active connections to the server when the ModXact
object releases its fd connection.

If the Max-Connection limit is reached squid puts the request to a waiters list.
When one or more connections released squid schedules one or more waiters for
execution and remove them from waiters list.
To handle cases where a waiter gone/canceled before its execution the custom
dialer ConnWaiterDialer used.

The Options connections counted as active connections but are not limited by
the Max-Connections limit. An Option request will be executed even if the
maximum connections number is reached.

This is a Measurement Factory project

14 years agoSquid-to-origin SNI for ssl-bump
Christos Tsantilas [Fri, 13 May 2011 07:59:19 +0000 (10:59 +0300)] 
Squid-to-origin SNI for ssl-bump

This patch adds Squid-to-server SSL Server Name Indication (SNI) support to the
outgoing connections in Squid.

This is a Measurement Factory project

14 years agoClarified TODO.
Alex Rousskov [Thu, 12 May 2011 04:01:29 +0000 (22:01 -0600)] 
Clarified TODO.

14 years agoRemoved Rock-specific code from StoreController.
Alex Rousskov [Thu, 12 May 2011 03:58:16 +0000 (21:58 -0600)] 
Removed Rock-specific code from StoreController.

Allow Store::dereference(e) to indicate whether the entry should
be kept in the global index. Old SwapDirs keep it. Newer code that
maintains entry tables dedicated to each cache_dir does not.

14 years agoObjects of unknown size are allowed into non-shared memory cache
Alex Rousskov [Wed, 11 May 2011 23:04:21 +0000 (17:04 -0600)] 
Objects of unknown size are allowed into non-shared memory cache

14 years agoPolished debugging, whitespace.
Alex Rousskov [Wed, 11 May 2011 22:57:17 +0000 (16:57 -0600)] 
Polished debugging, whitespace.

14 years agoFixed whitespace in cache_dir rock comments.
Alex Rousskov [Wed, 11 May 2011 22:38:35 +0000 (16:38 -0600)] 
Fixed whitespace in cache_dir rock comments.

14 years agoRemoved stale IamWorkerProcess() check and XXX: Caller checks that already.
Alex Rousskov [Wed, 11 May 2011 22:27:19 +0000 (16:27 -0600)] 
Removed stale IamWorkerProcess() check and XXX: Caller checks that already.
Polished.

14 years agoPolished MemStore::init() code.
Alex Rousskov [Wed, 11 May 2011 22:21:13 +0000 (16:21 -0600)] 
Polished MemStore::init() code.
No runtime changes expected.

14 years agoFix for "Support for slow ssl_bump ACLs" patch
Christos Tsantilas [Wed, 11 May 2011 12:29:30 +0000 (15:29 +0300)] 
Fix for "Support for slow ssl_bump ACLs" patch

Use "#if USE_SSL / #endif" for new ssl bump code added inside
ClientHttpRequest::doCallouts method to allow squid compile if ssl is not
enabled

14 years agoLanguages: Distribute and alias Slovenian
Amos Jeffries [Wed, 11 May 2011 05:04:29 +0000 (17:04 +1200)] 
Languages: Distribute and alias Slovenian

14 years ago"Language: sl added"
Aleksa Å uÅ¡uliÄ\87 [Wed, 11 May 2011 04:43:12 +0000 (16:43 +1200)] 
"Language: sl added"

14 years agoCacheMgr: Fix cache_peer options userhash/sourcehash display mixup
Amos Jeffries [Tue, 10 May 2011 12:51:32 +0000 (00:51 +1200)] 
CacheMgr: Fix cache_peer options userhash/sourcehash display mixup

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 10 May 2011 00:12:40 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoAdd ext_time_quota_acl helper
Tilmann Bubeck [Mon, 9 May 2011 12:42:59 +0000 (00:42 +1200)] 
Add ext_time_quota_acl helper

Allows an administrator to define time budgets for the users of squid
to limit the time using squid.

This is useful for corporate lunch time allocations, wifi portal
pay-per-minute installations or for parental control of children. The
administrator can define a time budget (e.g. 1 hour per day) which is
enforced through this helper.

14 years agoSupport for slow ssl_bump ACLs
Christos Tsantilas [Mon, 9 May 2011 07:48:55 +0000 (10:48 +0300)] 
Support for slow ssl_bump ACLs

Allow slow ACLs with ssl_bump option in squid.conf to enable destination
domain (and possibly other) slow ACL checks.

This is a Measurement Factory project.

14 years agoLink HttpRequest with ConnStateData early
Amos Jeffries [Mon, 9 May 2011 06:40:03 +0000 (18:40 +1200)] 
Link HttpRequest with ConnStateData early

14 years agoQoS: require libcap before enabling netfilter MARK support
Andrew Beverley [Sun, 8 May 2011 23:21:44 +0000 (11:21 +1200)] 
QoS: require libcap before enabling netfilter MARK support

As it is not possible to get or set a netfilter mark without libcap, this
patch will disable netfilter marking at compilation time if libcap is not
available (in a similar way to Linux transparent proxying).

14 years agoCleanup: sync NTLM and Negotiate UserRequest code
Amos Jeffries [Sun, 8 May 2011 13:53:10 +0000 (01:53 +1200)] 
Cleanup: sync NTLM and Negotiate UserRequest code

Minor tweaks to reduce diff between the files. No logic changes.

Renames the addHeader() to addAuthentiocationInfoHeader(),
Renames the addTrailer() to addAuthentiocationInfoTrailer() and
document that they add additional *-Info header to the HTTP reply.

14 years agoCleanup: Improve Connection Pinning management
Amos Jeffries [Sun, 8 May 2011 06:11:18 +0000 (18:11 +1200)] 
Cleanup: Improve Connection Pinning management

Since 1xx handing went in HttpRequest has had two links to the one
ConnStateData managing its client connection.

* Rename the 1xx link to clientConnectionManager (since it is not
  actually the connection, but the manager object controlling the FD
  usage and stats.

* Convert the pinning code to using the permanent clientConnectionManager
  link instead of a temporary pinned_connection link.

This moves all connection pinning state fully into the ConnStateData
manager objects scope.

Side changes that appear to be buggy code previously:

* do not alter pinning state at the point where the pinned connection is
  about to start being used. Changes are only relevant at the point of
  pinning or unpinning.

* unpin operation now closes the Server FD if still open. Previously
  there was the possibility that some code paths would leave server FD
  open and pconn it. (especially since the above mentioned state
  alteration cleared the "pinned" flag).

14 years agoBug 3215: Malformed ipv6 DNS reverse lookup
Amos Jeffries [Sat, 7 May 2011 12:24:15 +0000 (00:24 +1200)] 
Bug 3215: Malformed ipv6 DNS reverse lookup

14 years agoOnly ssl-bump CONNECT requests if they are about to be tunneled.
Amos Jeffries [Sat, 7 May 2011 02:19:06 +0000 (14:19 +1200)] 
Only ssl-bump CONNECT requests if they are about to be tunneled.

Currently all CONNECT requests are bumped, even if the redirectors have
determined a 3xx, 4xx or 5xx reply should happen.

Adapters and access controls use their own duplicated reply paths unaffected
by this bug at present.

14 years agoFix typo in parenthesis of flags test
Amos Jeffries [Sat, 7 May 2011 02:06:37 +0000 (14:06 +1200)] 
Fix typo in parenthesis of flags test

14 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 7 May 2011 00:12:36 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoImplicit Dependency removal for gcc-4.6.1
Amos Jeffries [Fri, 6 May 2011 16:16:45 +0000 (04:16 +1200)] 
Implicit Dependency removal for gcc-4.6.1

GCC 4.6.1 is stricter than 4.6.0. It does not by default include implicit
dependencies. This adds several unit tests .cc files which were implicitly
linked before.

Also adds tests/stub_DiskIOModule.cc to short-circuit the DiskIOModule API

14 years agoCacheMgr: display -i/+i in regex ACL config display
Amos Jeffries [Fri, 6 May 2011 14:31:36 +0000 (02:31 +1200)] 
CacheMgr: display -i/+i in regex ACL config display

14 years agoBug #3214: "helperHandleRead: unexpected read from ssl_crtd" errors.
Christos Tsantilas [Fri, 6 May 2011 09:17:54 +0000 (12:17 +0300)] 
Bug #3214: "helperHandleRead: unexpected read from ssl_crtd" errors.

Squid would read the beginning of a crtd response split across multiple
read operations and treat it as a complete response, causing various
certificate-related errors.

This patch:
 - allow the use of other than the '\n' character as the end of message mark
   for helper responses.
 - Use the '\1' char as end-of-message char for crtd helper. This char looks
   safe because the crtd messages are clear text only messages.

14 years agoBug 3209: ssl-bumped requests forwarded unencrypted to the parent proxies/caches
Christos Tsantilas [Fri, 6 May 2011 09:10:34 +0000 (12:10 +0300)] 
Bug 3209: ssl-bumped requests forwarded unencrypted to the parent proxies/caches

This patch block all ssl-bumped requests which does not forwarded directly to
origin servers.

A new flag added to the requests_flags to mark http requests which are
ssl-bumped

14 years agoSupport OpenSSL 1.0.0 built without SSLv2
Amos Jeffries [Wed, 4 May 2011 07:19:55 +0000 (19:19 +1200)] 
Support OpenSSL 1.0.0 built without SSLv2

14 years agoCompile fixes for binutils-gold and gcc-4.6 support
Amos Jeffries [Wed, 4 May 2011 03:05:09 +0000 (15:05 +1200)] 
Compile fixes for binutils-gold and gcc-4.6 support

These two tools are much stricter about dependency linkages. We have already
had to drop testAuth due to major dependency loops they dislike.
This makes the remainder of the dependency changes needed.

Also adds:
 - tests/STUB.h with macros for simpler stub file creation
 - stub_libmgr.cc for unit-test stub replacment of mgr/libmgr.la library.
   many API functions commented out, but sufficient for the current needs.

14 years agoDocs: spelling and syntax in manuals
Amos Jeffries [Wed, 4 May 2011 02:44:09 +0000 (14:44 +1200)] 
Docs: spelling and syntax in manuals

14 years agoTranslation .POT updates and docs spelling fixes
Amos Jeffries [Wed, 4 May 2011 02:03:34 +0000 (14:03 +1200)] 
Translation .POT updates and docs spelling fixes

14 years agoLanguage: en updates
Amos [Wed, 4 May 2011 00:07:57 +0000 (12:07 +1200)] 
Language: en updates

14 years agoLanguage: en updates
Amos [Wed, 4 May 2011 00:05:11 +0000 (12:05 +1200)] 
Language: en updates

14 years agoLanguage: en updates
Amos [Tue, 3 May 2011 06:01:46 +0000 (18:01 +1200)] 
Language: en updates

14 years agoDocs: Polish url_rewrite_program description
Colin Coe [Tue, 3 May 2011 03:01:59 +0000 (15:01 +1200)] 
Docs: Polish url_rewrite_program description

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 3 May 2011 00:12:39 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoDrop testAuth unit-tests
Amos Jeffries [Mon, 2 May 2011 13:04:21 +0000 (01:04 +1200)] 
Drop testAuth unit-tests

Preparing to move the tests into src/auth.

These old tests construction style also require quite a lot of dependencies
which include several loops causing problems in modern strict linkers.
Opted to remove now and stabilize trunk without it before re-adding simpler
auth unit tests.

14 years agotypo in ntlm_fake_auth
Amos Jeffries [Mon, 2 May 2011 02:33:27 +0000 (20:33 -0600)] 
typo in ntlm_fake_auth

14 years agoCleanup: base64 coder de-duplication and upgrade
Amos Jeffries [Mon, 2 May 2011 01:14:30 +0000 (19:14 -0600)] 
Cleanup: base64 coder de-duplication and upgrade

Markus Moeller has re-implemented several of the coder functions for use
by Kerberos helpers.

This patch seeks to de-duplicate them and combine the resulting code
back into the libmiscencoding.la "base64.h" implementation.

Changes include:

  * old function API renamed to old_*() and existing code update to use
the names. Some code has been updated to use the new API.

  * new estimator base64_encode_len()/base64_decode_len() functions added
to provide details of much much buffer space the output will require.

  * new API encoder and decoder functions added which accept caller
provided buffers and encode/decode an arbitrary string into them.

  * also fixes a bug where if the input text or output buffer was too
short the coder functions would crop a few bytes off the end of the result.
Noticable in Kerberos where token lengths are not fixed length.

Some optimizations have been added by myself over and above Markus changes:

  * optimized to short-circuit on several more variations of empty input
and nil result buffer.

  * sub-loop optimizations added to reduce the number of if() calls made
by the new code.

  * split encoder into terminated (C-str) and non-terminated variants.

Also documented both old and new APIs functions.

14 years agoAdd external_acl_type %EXT_LOG and %EXT_TAG format options.
James Bowe [Sun, 1 May 2011 12:10:37 +0000 (00:10 +1200)] 
Add external_acl_type %EXT_LOG and %EXT_TAG format options.

%EXT_LOG and %EXT_TAG are filled with the log= and tag= fields
returned by previous external ACLs.

-for a string that never changes after it is set, tag= is suitable.
-for a string that may need updating or overwriting by a later
external_acl, log= is suitable.

Under both circumstances it is conceivable that later external_acls
may need access to the tag= or log= values after they have been set
(e.g. for external_acl debugging, merging log messages, etc).

14 years agoBug 3203: pkg-config replacement broken on Windows
Amos Jeffries [Sun, 1 May 2011 03:03:37 +0000 (15:03 +1200)] 
Bug 3203: pkg-config replacement broken on Windows

14 years agoExtraced the write-to-store step from StoreEntry::replaceHttpReply().
Alex Rousskov [Thu, 28 Apr 2011 22:45:55 +0000 (16:45 -0600)] 
Extraced the write-to-store step from StoreEntry::replaceHttpReply().

This allows the caller to set the reply for the entry and then update the
entry and the reply before writing them to store. For example, the server-side
haveParsedReplyHeaders() code needs to set the entry timestamps and make the
entry key public before the entry starts swapping out, but the same code also
needs access to entry->getReply() and such for timestampsSet() and similar
code to work correctly.

TODO: Calls to StoreEntry::replaceHttpReply() do not have to be modified
because replaceHttpReply() does write by default. However, it is likely that
callers other than ServerStateData::setFinalReply() should take advantage of
the new split interface because they call timestampsSet() and such after
replaceHttpReply().

14 years agoBug 3205: SSL-bump is broken in trunk
Christos Tsantilas [Thu, 28 Apr 2011 19:32:43 +0000 (22:32 +0300)] 
Bug 3205: SSL-bump is broken in trunk

The bug appeared after commit with revno:11364 which fixes the Bug #3192.

In the case of SSL-bumped connections the ConnStateData::flags.readMore flag
must be reset (set to true) when we are switching to HTTPs,
because we have to read the new unencrypted HTTP request.
This patch reset this flag in ConnStateData::switchToHttps method.

14 years agoUpdate release notes on deny_info changes
Amos Jeffries [Thu, 28 Apr 2011 17:04:06 +0000 (05:04 +1200)] 
Update release notes on deny_info changes

14 years agoMove max_size and n_disk_objects to specific SwapDirs, remove updateSize().
Dmitry Kurochkin [Thu, 28 Apr 2011 12:23:55 +0000 (16:23 +0400)] 
Move max_size and n_disk_objects to specific SwapDirs, remove updateSize().

14 years agoPerformance: short-circuit reply_body_max_size ACL tests
Amos Jeffries [Wed, 27 Apr 2011 23:48:03 +0000 (11:48 +1200)] 
Performance: short-circuit reply_body_max_size ACL tests

In the common default case there are no reply body limits configured.
There is no need to construct ACL checklists for testing. This saves
one allocation and several locking/unlocking cycles per request.

14 years agoStore Config.Store.avgObjectSize in bytes.
Dmitry Kurochkin [Wed, 27 Apr 2011 23:40:56 +0000 (03:40 +0400)] 
Store Config.Store.avgObjectSize in bytes.

14 years agoChange SwapDir::max_size to bytes, make it protected, use maxSize() instead.
Dmitry Kurochkin [Wed, 27 Apr 2011 23:34:13 +0000 (03:34 +0400)] 
Change SwapDir::max_size to bytes, make it protected, use maxSize() instead.

14 years agoRemove updateSize() from Store and make it protected in SwapDir.
Dmitry Kurochkin [Wed, 27 Apr 2011 20:30:31 +0000 (00:30 +0400)] 
Remove updateSize() from Store and make it protected in SwapDir.

A new SwapDir public method swappedOut() added. It is called from
storeSwapOutFileClosed() to notify SwapDir that an object was swapped
out.

14 years agoChange Config.cacheSwap.swapDirs and StoreEntry::store() type to SwapDir.
Dmitry Kurochkin [Wed, 27 Apr 2011 19:05:15 +0000 (23:05 +0400)] 
Change Config.cacheSwap.swapDirs and StoreEntry::store() type to SwapDir.

This allows using SwapDir API without dynamic_cast.

14 years agoDo not call updateSize() from Rock::SwapDir::addEntry(), it is NOP for Rock.
Dmitry Kurochkin [Wed, 27 Apr 2011 14:01:49 +0000 (18:01 +0400)] 
Do not call updateSize() from Rock::SwapDir::addEntry(), it is NOP for Rock.

14 years agoChange SwapDir::cur_size to bytes, make it private, use currentSize() instead.
Dmitry Kurochkin [Wed, 27 Apr 2011 13:57:13 +0000 (17:57 +0400)] 
Change SwapDir::cur_size to bytes, make it private, use currentSize() instead.

14 years agoMake Store::currentSize() return size in bytes.
Dmitry Kurochkin [Wed, 27 Apr 2011 13:26:03 +0000 (17:26 +0400)] 
Make Store::currentSize() return size in bytes.

14 years agoCode polishing: move Rock store entry limit calculation to entryLimitAllowed().
Dmitry Kurochkin [Wed, 27 Apr 2011 02:29:22 +0000 (06:29 +0400)] 
Code polishing: move Rock store entry limit calculation to entryLimitAllowed().

14 years agoInitialize and cleanup Rock shared maps using RunnersRegistry API.
Dmitry Kurochkin [Wed, 27 Apr 2011 01:52:46 +0000 (05:52 +0400)] 
Initialize and cleanup Rock shared maps using RunnersRegistry API.

14 years agoRework shared queue for IpcIoFile, further optimize IpcIo notifications.
Dmitry Kurochkin [Tue, 26 Apr 2011 20:39:59 +0000 (00:39 +0400)] 
Rework shared queue for IpcIoFile, further optimize IpcIo notifications.

The patch implements a FewToFewBiQueue class that allows
communication between two group of processes.  The queue is used
in IpcIoFile and allows to have a single shared queue reader
state for each process (both diskers and workers).  This
continues the optimization started in r11279, see commit log for
more details.

The patch also decreases the number of shared memory segment used
by queues.  Before the change, FewToOneBiQueue used
(2*workerCount + 1) number of segments. Now FewToFewBiQueue uses
just three: for shared metadata, for array of one-to-one queues
and for array of queue readers.

14 years agoBug fix: A dirty last/unused item left after Vector<>::shift
Christos Tsantilas [Tue, 26 Apr 2011 10:15:04 +0000 (13:15 +0300)] 
Bug fix: A dirty last/unused item left after Vector<>::shift

This is an old Vector<> bug that left a dirty last/unused item after
shift(). This causes problems if stored values have destructors.

14 years agoMove shared queues to Ipc namespace.
Dmitry Kurochkin [Mon, 25 Apr 2011 19:29:41 +0000 (23:29 +0400)] 
Move shared queues to Ipc namespace.

14 years agoUse shared pages in IpcIoFile instead of passing data through shared queues.
Dmitry Kurochkin [Mon, 25 Apr 2011 19:24:35 +0000 (23:24 +0400)] 
Use shared pages in IpcIoFile instead of passing data through shared queues.

14 years agoFix queue index in IpcIoFile debug message.
Dmitry Kurochkin [Mon, 25 Apr 2011 16:04:59 +0000 (20:04 +0400)] 
Fix queue index in IpcIoFile debug message.

This could lead to out of bounds array access and segfault.

14 years agoRework shared object design and management API.
Dmitry Kurochkin [Mon, 25 Apr 2011 15:14:10 +0000 (19:14 +0400)] 
Rework shared object design and management API.

Before the patch, each shared object was responsible for allocating
and deallocating shared memory it uses.  As a result each object had a
shared and non shared portion.  Shared classes provided a pair of
static methods for creating and attaching to existing shared segments.

This is against how normal objects behave: normal objects are not
responsible for managing memory they use, they use the memory they are
given.  Besides the old approach mixes shared memory management and
object initialization logic.  The patch tries to improve this.

On the user side, the patch provides two functions for managing shared
objects:

* shm_new - allocates/deallocates shared memory, initializes the object
* shm_old - gives refcounted access to the object created by shm_new

Shm_new function returns so called Owner object.  It is not used for
working with the shared object, but to do shared memory
allocation/deallocation and object initialization.  This function will
be typically used in Squid master process to allocate shared memory on
startup.  On exit, the Owner object is deleted and shared object is
deallocated.

Shm_old function returns a refcounted smart pointer to the shared
object.  It does not allocate shared memory or initialize the object,
but just points to the object owned by the Owner.  Smart pointer
provides a simple way for working with the shared object.

On the internal side, the patch removes shared memory
allocation/deallocation from shared object class.  There is no more
local/shared parts.  Shared object class implementation is now similar
to an ordinary class.  The additional requirements for "shared"
classes are: the object must be a POD with no pointers to or
references; provides a static SharedMemorySize method for shared
memory size calculation; may need to use atomic primitives for safe
updates of data members.

All existing "shared" classes and code were converted to the new API.

14 years agoPortability fix: explicitly state dependency on libtool 2.2+ and enforce it
Francesco Chemolli [Sat, 23 Apr 2011 07:11:07 +0000 (09:11 +0200)] 
Portability fix: explicitly state dependency on libtool 2.2+ and enforce it

14 years agoPortability fix: always install libltdl and change autoconf initialization
Francesco Chemolli [Sat, 23 Apr 2011 05:32:01 +0000 (07:32 +0200)] 
Portability fix: always install libltdl and change autoconf initialization

14 years agoRemove obsolete XXX: IpcIoMsg objects are no longer sent over UDS.
Dmitry Kurochkin [Wed, 20 Apr 2011 18:45:33 +0000 (22:45 +0400)] 
Remove obsolete XXX: IpcIoMsg objects are no longer sent over UDS.

14 years agoTemporary fix for coredumps during shutdown cleanup. take06
Alex Rousskov [Thu, 21 Apr 2011 15:19:31 +0000 (09:19 -0600)] 
Temporary fix for coredumps during shutdown cleanup.

For a permanent fix, we need to avoid deleting fd_table while it is still
in use by others, such as DeferredReads, possibly by allowing event loop
to run during shutdown.

14 years agoDisable shared memory cache when not running in SMP mode.
Alex Rousskov [Thu, 21 Apr 2011 15:13:33 +0000 (09:13 -0600)] 
Disable shared memory cache when not running in SMP mode.