]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
11 years agocachemgr: Enable per-report Content-Type header
Amos Jeffries [Mon, 20 Jan 2014 01:11:58 +0000 (14:11 +1300)] 
cachemgr: Enable per-report Content-Type header

The default for all reports is plain text in UTF-8.

NOTE: UTF-8 selected because although current reports limit themselves
to ASCII character ranges, some reports may contain text pulled from the
protocol transferred and UTF-8 display covers most unexpected cases.

11 years agoCleanup refreshCountsStats() cache manager code
Amos Jeffries [Mon, 20 Jan 2014 00:50:04 +0000 (13:50 +1300)] 
Cleanup refreshCountsStats() cache manager code

* Replace a #define macro with local static function.

* Replace pointer parameter with reference

* suppress display of histograms where there are no records and so no
  meaningful content to be displayed.

11 years agoDocs: update refresh_pattern internal documentation
Amos Jeffries [Sun, 19 Jan 2014 22:43:22 +0000 (11:43 +1300)] 
Docs: update refresh_pattern internal documentation

11 years agoFix external_acl_type async loop failures
Amos Jeffries [Fri, 17 Jan 2014 11:44:26 +0000 (03:44 -0800)] 
Fix external_acl_type async loop failures

When externa_acl_type uses %LOGIN and is required to trigger async
authentication lookups it returns and hits the async loop prevention
check when starting to trigger its own external helper lookup. This
results in a DUNNO output from the helper as final status instead of
the real helepr lookup result.

Avoid these by allowing async helpers to loop several times before
aborting the lookups.

Also, extend debug message to indicate loop count.

Thanks to Peter Benko for trackign down the issue and testing solutions.

11 years agoRevert and replace rev.13234
Amos Jeffries [Thu, 16 Jan 2014 00:24:34 +0000 (13:24 +1300)] 
Revert and replace rev.13234

Clang dentifies the StoreIOBuffer parameter as unsigned,
  error: comparison of unsigned expression < 0 is always false

11 years agoBug 4008: HttpHeader warnOnError should be an int not a bool
Will Roberts [Wed, 15 Jan 2014 23:57:54 +0000 (12:57 +1300)] 
Bug 4008: HttpHeader warnOnError should be an int not a bool

11 years agoCleanup: Fix StoreIOBuffer initialization cases
Amos Jeffries [Wed, 15 Jan 2014 02:11:05 +0000 (15:11 +1300)] 
Cleanup: Fix StoreIOBuffer initialization cases

When StoreIOBuffer isconstructed with an invalid (negative) size for the
content data mark it as an error immedately and set a valid length of
zero bytes.

Also, remove some unnecessary code in store_client.cc resulting.

  Detected by Coverity Scan. Issue 434132.

11 years agoCleanup: Improve testACLMaxUserIP NULL checks
Amos Jeffries [Wed, 15 Jan 2014 01:59:19 +0000 (14:59 +1300)] 
Cleanup: Improve testACLMaxUserIP NULL checks

  Detected by Coverity Scan. Issue 1140358.

11 years agoCleanup: ICAP adaptation pointer handling
Amos Jeffries [Wed, 15 Jan 2014 01:54:19 +0000 (14:54 +1300)] 
Cleanup: ICAP adaptation pointer handling

Divert unlikely but possible request NULL pointer into the Must()
condition handler for missing History data.

 Detected by Coverity Scan. Issue 740365.

11 years agoFix rfcnb library potential NULL pointer dereference
Amos Jeffries [Wed, 15 Jan 2014 01:23:14 +0000 (14:23 +1300)] 
Fix rfcnb library potential NULL pointer dereference

Malformed RFCNB packet may lead to crash.

 Detected by Coverity Scan. Issue 740355.

11 years agoFix memory leak in peer cache Digest exchange
Amos Jeffries [Tue, 14 Jan 2014 21:29:20 +0000 (10:29 +1300)] 
Fix memory leak in peer cache Digest exchange

 Detected by Coverity Scan. Issue 1094115.

11 years agoFix MemMapSlot constructor initialization of expiry TTL
Amos Jeffries [Tue, 14 Jan 2014 21:16:23 +0000 (10:16 +1300)] 
Fix MemMapSlot constructor initialization of expiry TTL

Also, restyle MemMap constructor initialization list.

  Detected by Coverity Scan. Issue 1153961.

11 years agoShuffle coverity marker
Francesco Chemolli [Tue, 14 Jan 2014 20:36:03 +0000 (21:36 +0100)] 
Shuffle coverity marker

11 years agoMark a behavior detected by Coverity as defect as intentional
Francesco Chemolli [Tue, 14 Jan 2014 17:18:08 +0000 (18:18 +0100)] 
Mark a behavior detected by Coverity as defect as intentional

11 years agoBug 3986: assertion failed due to incorrect error page buffer size
Amos Jeffries [Mon, 13 Jan 2014 21:03:45 +0000 (10:03 +1300)] 
Bug 3986: assertion failed due to incorrect error page buffer size

errorpage.cc:1307:
   "(size_t)content->contentSize() == strlen(content->content())"

11 years agoSMP SSL session cache implementation
Christos Tsantilas [Sun, 12 Jan 2014 17:51:12 +0000 (19:51 +0200)] 
SMP SSL session cache implementation

This patch implement SSL session cache sharing across SMP workers using shared
memory. The following new squid configuration options added:

 - The "sslproxy_session_cache_size" option which sets the cache size to use
   for ssl session. Example usage:
     sslproxy_session_cache_size 4 MB

 - The "sslproxy_session_ttl" option which defines the time in seconds the
   ssl session is valid. Example usage:
     sslproxy_session_ttl  600

This is a Measurement Factory project

11 years agoSMP shared cache with timeouts for squid
Christos Tsantilas [Sun, 12 Jan 2014 17:15:45 +0000 (19:15 +0200)] 
SMP shared cache with timeouts for squid

This patch investigates the Ipc::MemMap class which is a shared cache with
timeouts for use with squid SMP.

TODO: Ipc::MemMap class has similar interfaces and functionality with the
Ipc::StoreMap class. These two classes should implemented as kid classes of
an Ipc::SharedCache class which encompass features from Ipc::MemMap and
Ipc::StoreMap classes.

This is a Measurement Factory project

11 years agoCoverity defect 1151594: side-effect in assertion in CollapsedForwarding
Francesco Chemolli [Fri, 10 Jan 2014 19:01:04 +0000 (20:01 +0100)] 
Coverity defect 1151594: side-effect in assertion in CollapsedForwarding

11 years agoDocument and enforce invariant on Format::Token.divisor
Francesco Chemolli [Fri, 10 Jan 2014 15:50:03 +0000 (16:50 +0100)] 
Document and enforce invariant on Format::Token.divisor

11 years agoFix coding ambiguity in store_repl_heap.cc and heap.h
Francesco Chemolli [Fri, 10 Jan 2014 15:46:59 +0000 (16:46 +0100)] 
Fix coding ambiguity in store_repl_heap.cc and heap.h

11 years agoDocs: fix various doxygen compiler issues
Amos Jeffries [Sat, 11 Jan 2014 01:35:50 +0000 (17:35 -0800)] 
Docs: fix various doxygen compiler issues

11 years agoSquidNew: don't redefine new and delete on clang
Francesco Chemolli [Thu, 9 Jan 2014 13:53:54 +0000 (14:53 +0100)] 
SquidNew: don't redefine new and delete on clang

11 years agoFix include guard in include/rfc1123.h
Francesco Chemolli [Thu, 9 Jan 2014 13:52:08 +0000 (14:52 +0100)] 
Fix include guard in include/rfc1123.h

11 years agoFix header-guard in include/uudecode.h
Francesco Chemolli [Thu, 9 Jan 2014 13:11:42 +0000 (14:11 +0100)] 
Fix header-guard in include/uudecode.h

11 years agoFix header-guards in compat/os/hpux.h
Francesco Chemolli [Thu, 9 Jan 2014 13:04:32 +0000 (14:04 +0100)] 
Fix header-guards in compat/os/hpux.h

11 years agoBug 3996: Malformed DNS reply leads to crash
Susant Sahani [Thu, 9 Jan 2014 20:27:49 +0000 (12:27 -0800)] 
Bug 3996: Malformed DNS reply leads to crash

11 years agoBug 3927: tests/testRock fatal.cc required
Amos Jeffries [Thu, 9 Jan 2014 01:07:56 +0000 (18:07 -0700)] 
Bug 3927: tests/testRock fatal.cc required

11 years agoDisable error page translation by default in builds
Amos Jeffries [Sun, 5 Jan 2014 20:19:06 +0000 (12:19 -0800)] 
Disable error page translation by default in builds

There is no need for every build from VCS to have fresh translations.

Enable explicitly for snapshot and release scripts instead so that
translated template files are still available online and pre-translated
in the distributed packages.

11 years agoCleanup: remove ClientSocketContextNew() wrapper function
Amos Jeffries [Sun, 5 Jan 2014 19:49:23 +0000 (11:49 -0800)] 
Cleanup: remove ClientSocketContextNew() wrapper function

This wrapper function for the ClientSocketContext default constructor
is better performed as an explicit parametered constructor which
prevents accidental use of the default constructor leading to invalid
state after creation (a context always requires connectino and parent
pointers).

11 years agoCleanup: remove useless makesnmplib variable from build
Amos Jeffries [Wed, 8 Jan 2014 04:29:04 +0000 (21:29 -0700)] 
Cleanup: remove useless makesnmplib variable from build

Squid coding guidelines require automake variables to use naming pattern
ENABLE_* and there is already ENABLE_SNMP defined with intended overlap
of usage. We can drop this unusual variable completely.

11 years agoCentrally destroy all explicit and implicit ACLs to avoid destruction segfaults
Alex Rousskov [Mon, 6 Jan 2014 20:55:13 +0000 (13:55 -0700)] 
Centrally destroy all explicit and implicit ACLs to avoid destruction segfaults
during reconfiguration.

Group ACLs created later may use other ACLs created earlier and vice versa, a
group ACL created earlier may use other ACLs created later. The latter is
possible when an ACL (e.g., A2 below) is declared when the group already
exists:

  acl A1 src 127.0.0.1
  acl Group all-of A1
  acl A2 src 127.0.0.2
  acl Group all-of A2

Thus, the group (i.e., InnerNode) ACL destructor may access already deleted
children regardless of the global ACL deletion order (FIFO or LIFO with
respect to ACL creation). Instead of relying on the deletion order to protect
InnerNode, we remove the InnerNode ACL destructor completely and rely on a
global set of registered ACLs to destroy all ACLs.

The old code was destroying all explicit ACLs in the same centralized fashion.
We now add implicit ACLs (commonly used by InnerNodes) to the centralized
destruction sequence. We added a new destruction-dedicated container to avoid
messing with the by-name ACL search that Config.aclList global is used for.
This new container will become unnecessary once we start refcounting ACLs.

11 years agoRelease Notes update for 2.5
Amos Jeffries [Sun, 5 Jan 2014 03:04:03 +0000 (19:04 -0800)] 
Release Notes update for 2.5

11 years agoAdd logformat code %>rd to log client URL domain name
Amos Jeffries [Sun, 5 Jan 2014 02:56:31 +0000 (18:56 -0800)] 
Add logformat code %>rd to log client URL domain name

Logging the Host header or the full URL have been the only ways to log
the domain name requested by the client. However full URL may contain
far too many unwanted bytes and Host header many contain a host:port
very different to the URL.

 This work is sponsored by Brendan Kearney

11 years agoBug 3995: compile error on CentOS 5 with GCC 4.1.2
Reinhard Sojka [Mon, 6 Jan 2014 01:10:00 +0000 (14:10 +1300)] 
Bug 3995: compile error on CentOS 5 with GCC 4.1.2

11 years agoMerge from CharacterSet
Francesco Chemolli [Sun, 5 Jan 2014 21:59:17 +0000 (22:59 +0100)] 
Merge from CharacterSet

11 years agoRemoved CharacterSet::CRLF and clarified some comments
Francesco Chemolli [Sun, 5 Jan 2014 21:58:13 +0000 (22:58 +0100)] 
Removed CharacterSet::CRLF and clarified some comments

11 years agoMerged from trunk
Francesco Chemolli [Sun, 5 Jan 2014 13:07:44 +0000 (14:07 +0100)] 
Merged from trunk

11 years agoMerge storeentry-refactor, fix store unit test
Francesco Chemolli [Fri, 3 Jan 2014 17:52:35 +0000 (18:52 +0100)] 
Merge storeentry-refactor, fix store unit test

11 years agoBaseMultiQueue is virtual but had no virtual destructor
Francesco Chemolli [Fri, 3 Jan 2014 11:13:52 +0000 (12:13 +0100)] 
BaseMultiQueue is virtual but had no virtual destructor

11 years agoGot rid of Store.cci
Francesco Chemolli [Fri, 3 Jan 2014 10:32:53 +0000 (11:32 +0100)] 
Got rid of Store.cci

11 years agoFix SBuf::rfind
Amos Jeffries [Thu, 2 Jan 2014 23:03:20 +0000 (00:03 +0100)] 
Fix SBuf::rfind

11 years agoMerged from trunk
Francesco Chemolli [Thu, 2 Jan 2014 17:12:37 +0000 (18:12 +0100)] 
Merged from trunk

11 years agoFix SBuf and SBufList unit tests linkage
Francesco Chemolli [Thu, 2 Jan 2014 16:01:57 +0000 (17:01 +0100)] 
Fix SBuf and SBufList unit tests linkage

11 years agotests/testSBufList on CentOS needs MemObject::endOffset().
Alex Rousskov [Thu, 2 Jan 2014 05:13:17 +0000 (22:13 -0700)] 
tests/testSBufList on CentOS needs MemObject::endOffset().

11 years agoInitial Large Rock and Collapsed Forwarding support.
Alex Rousskov [Wed, 1 Jan 2014 20:13:23 +0000 (13:13 -0700)] 
Initial Large Rock and Collapsed Forwarding support.

Large Rock: Support disk (and shared memory) caching of responses exceeding
one db slot (or one shared memory page) in size. A single db slot/page size is
still limited to 32KB (smaller values can be configured for disk caches using
the newly added cache_dir slot-size option). Removal of old rock cache dir
(followed by squid-z) is required -- the on-disk db structure has changed.

Collapsed Forwarding: Optionally merge concurrent cachable requests for the
same URI earlier: After the request headers have been parsed (as before), but
now _before_ the response headers have been received. Merging of requests
received by different SMP workers is supported. Controlled by the new
collapsed_forwarding directive in squid.conf. Disabled by default because all
but one of the merged requests have to be delayed (until the response headers
are received) for the merging to work, which may be worse than forwarding all
concurrent requests immediately. The overall feature idea and request
eligibility conditions are based on Collapsed Forwarding in Squid2.

Summary of other important changes (merged branch log contains the details):

* Tightened StoreEntry locking. Split StoreEntry::lock() into "just lock" and
  "update entry reference time" interfaces, addressing an old XXX.  Improved
  entry lock/unlock debugging. Needs more work.

* Adjusted StoreIOState::write() API to allow callers detect write errors.

* Simplified MemObject::write() API to remove an essentially unused callback.

* Mark client streams that sent everything as STREAM_COMPLETE. The old code
  used STREAM_UNPLANNED_COMPLETE if the completed stream was associated with a
  non-persistent connection, which did not make sense to me and, IIRC, led to
  store entry aborts even though the entries were not damaged in any way.

* mem_hdr::hasContigousContentRange() now returns true for empty ranges.

* Support "appending" ReadWriteLock state that can be shared by readers and
  the writer. The writer promises not to update key metadata (except growing
  object size and next pointers) and readers promise to be careful when
  reading growing slices.

* Fixed StoreEntry::mayStartSwapOut() logic to handle terminated swapouts.

* Improved STORE_MEM_CLIENT detection and documented known (and mostly old)
  StoreEntry::storeClientType() problems.

* Removed StoreEntry::hidden_mem_obj hack.

* Polished StoreEntry debugging to report more info, less noise. Use e: prefix.

* Added a script to extract store entry(ies) debugging from cache.log.

11 years agoAdded MemBlob::appended() method. Handy during out-of-band buffer manipulation.
Alex Rousskov [Wed, 1 Jan 2014 20:11:16 +0000 (13:11 -0700)] 
Added MemBlob::appended() method. Handy during out-of-band buffer manipulation.

11 years agoMerged from trunk 13199.
Alex Rousskov [Wed, 1 Jan 2014 19:20:49 +0000 (12:20 -0700)] 
Merged from trunk 13199.

11 years agoRemoved stale copy-pasted boilerplate.
Alex Rousskov [Wed, 1 Jan 2014 17:51:10 +0000 (10:51 -0700)] 
Removed stale copy-pasted boilerplate.

11 years agoAdded missing stubs in testCharacterSet
Francesco Chemolli [Wed, 1 Jan 2014 17:15:10 +0000 (18:15 +0100)] 
Added missing stubs in testCharacterSet

11 years agoSourceFormat Enforcement
Alex Rousskov [Tue, 31 Dec 2013 18:49:41 +0000 (11:49 -0700)] 
SourceFormat Enforcement

11 years agoPolishing touches to address PREVIEW review concerns dated 2013/07/03.
Alex Rousskov [Tue, 31 Dec 2013 18:09:24 +0000 (11:09 -0700)] 
Polishing touches to address PREVIEW review concerns dated 2013/07/03.

11 years agoDo not use HERE in new or changed debugs() statements.
Alex Rousskov [Mon, 30 Dec 2013 23:58:33 +0000 (16:58 -0700)] 
Do not use HERE in new or changed debugs() statements.

Polished StoreEntry creation/destruction debugging.

11 years agoReverted multi-ranges as they require c++0x initializers
Francesco Chemolli [Mon, 30 Dec 2013 13:22:05 +0000 (14:22 +0100)] 
Reverted multi-ranges as they require c++0x initializers

11 years agoPrep for 3.4.2
Amos Jeffries [Mon, 30 Dec 2013 10:48:15 +0000 (03:48 -0700)] 
Prep for 3.4.2

11 years agoFix CharacterSet ranged constructor
Francesco Chemolli [Mon, 30 Dec 2013 09:57:55 +0000 (10:57 +0100)] 
Fix CharacterSet ranged constructor

11 years agomore predefined charactersets
Francesco Chemolli [Mon, 30 Dec 2013 09:44:52 +0000 (10:44 +0100)] 
more predefined charactersets

11 years agoAdded ability to manage ranges to CharacterSet
Francesco Chemolli [Mon, 30 Dec 2013 07:05:21 +0000 (08:05 +0100)] 
Added ability to manage ranges to CharacterSet

11 years agoImplemented CharacterSet's operator + and addRange, fixed bug in interface of operato...
Francesco Chemolli [Sun, 29 Dec 2013 22:59:39 +0000 (23:59 +0100)] 
Implemented CharacterSet's operator + and addRange, fixed bug in interface of operator+=, added some common CharacterSets, initial unit tests

11 years agoMerged from trunk
Francesco Chemolli [Sun, 29 Dec 2013 21:48:26 +0000 (22:48 +0100)] 
Merged from trunk

11 years agoBug 3498: FTP PUT assertion Server.cc:246: "r->body_pipe != NULL"
Alex Rousskov [Sun, 29 Dec 2013 15:56:02 +0000 (07:56 -0800)] 
Bug 3498: FTP PUT assertion Server.cc:246: "r->body_pipe != NULL"

11 years agoMade test-builds.sh happy by adding missing stubs and adjusting existing ones.
Alex Rousskov [Sun, 29 Dec 2013 05:30:26 +0000 (22:30 -0700)] 
Made test-builds.sh happy by adding missing stubs and adjusting existing ones.

11 years agoUpdated tests/testRock and the store rebuild stubs it needs.
Alex Rousskov [Fri, 27 Dec 2013 18:37:26 +0000 (11:37 -0700)] 
Updated tests/testRock and the store rebuild stubs it needs.
Synced tests/testUfs after updating the store rebuild stubs.

Store uses StoreController::store_dirs_rebuilding to decide whether the entry
release should be delayed. Thus, storeRebuildComplete() must update it. Also
synced the corresponding CPPUNIT_ASSERT_EQUAL() statements to expect a zero
value after the rebuild is completed.

Do not create an entry just to get its key: Creating forces a public key which
necessarily invalidates the previously cached entry with the same key, if any.

Unlock unused entries. This helps with their release later (and adds more
realism to the test case).

Fixed entry #5 test case to account for the fact that creating a second entry
with the same public key invalidates the first entry.

Release instead of just unlinking entries. StoreEntry::release() is the public
interface which updates internal tables as needed. StoreEntry::unlink() is an
internal call for updating the disk cache-related state; it does not update
the the in-transit index.

11 years agoCheck that StoreEntry lock does not go negative
Alex Rousskov [Fri, 27 Dec 2013 18:34:41 +0000 (11:34 -0700)] 
Check that StoreEntry lock does not go negative
which may happen if unlocked (and possibly deleted) entry is unlocked (again).

11 years agoBug 3806: Caching responses with Vary header
Alex Rousskov [Mon, 23 Dec 2013 05:26:23 +0000 (22:26 -0700)] 
Bug 3806: Caching responses with Vary header

Various fixes making Vary caching work better.
More work is needed to re-enable shared memory caching of Vary responses.

bag5s r12741: Do not start storing the vary marker object until its key becomes public.
bag5s r12742: Log failed (due to "Vary object loop" or "URL mismatch") hits as TCP_MISSes.
bag5s r12743: Refuse to cache Vary-controlled objects in shared memory (for now).

Based on trunk r13179.

11 years agoBug 3985: 60s limit introduced by balance_on_multiple_ip breaks bad IP recovery
Jakob Bohm [Sat, 21 Dec 2013 17:31:59 +0000 (09:31 -0800)] 
Bug 3985: 60s limit introduced by balance_on_multiple_ip breaks bad IP recovery

Alternative fix if necessary would be to calculate a dynamic timeout
value based on number and timeouts for connections and forwarding.

However, as noted in the bug report the address markings are reset every
TTL when the stored RR are replaced. This meets the criteria for periodic
retries of marked-BAD IPs. Also if all IPs are marked BAD they all get
un-marked and retried. So for now just remove the TTL hack.

11 years agoFix \-unescaping in quoted strings from helpers
Amos Jeffries [Sat, 21 Dec 2013 04:54:54 +0000 (20:54 -0800)] 
Fix \-unescaping in quoted strings from helpers

strwordtok() was unescaping '\' values in unquoted tokens. This causes
problems with NTLM helper response user\DOMAIN values which are sent as
a un-quoted un-escaped value.

Restrict un-escaping of '\' to only occur when inside "quoted" words.

11 years agoWCCPv2: fix assertion 'Cannot convert non-IPv4 to IPv4' on FreeBSD
Amos Jeffries [Fri, 20 Dec 2013 11:34:44 +0000 (03:34 -0800)] 
WCCPv2: fix assertion 'Cannot convert non-IPv4 to IPv4' on FreeBSD

FreeBSD does not set the from-address on recv() if there was an error
reading the packet. This can result in Ip::Address assertion if the
error is not checked for before the IP address is mapped into Squid
internal format.

11 years agoFix missing cast in rev.13162
Amos Jeffries [Fri, 20 Dec 2013 05:55:43 +0000 (22:55 -0700)] 
Fix missing cast in rev.13162

11 years agoMade "make check" happier by syncing test case with Store API changes
Alex Rousskov [Thu, 19 Dec 2013 23:13:24 +0000 (16:13 -0700)] 
Made "make check" happier by syncing test case with Store API changes
and making StoreEntry::hashDelete() more forgiving.

11 years agoAdded missing header in client_side_reply.cc for clang
Francesco Chemolli [Thu, 19 Dec 2013 13:47:27 +0000 (14:47 +0100)] 
Added missing header in client_side_reply.cc for clang

11 years agoAdd missing StoreEntry::lock() parameters, require unlock() parameter,
Alex Rousskov [Thu, 19 Dec 2013 04:53:35 +0000 (21:53 -0700)] 
Add missing StoreEntry::lock() parameters, require unlock() parameter,
and polish un/lock() context debugging.

11 years agoFix missing include in rev.13190
Amos Jeffries [Thu, 19 Dec 2013 00:55:46 +0000 (17:55 -0700)] 
Fix missing include in rev.13190

11 years agoAdded StoreEntry::lock() call dropped when merging from trunk r13172.
Alex Rousskov [Wed, 18 Dec 2013 22:32:14 +0000 (15:32 -0700)] 
Added StoreEntry::lock() call dropped when merging from trunk r13172.

11 years agoRename SBuf::find_first_of and find_first_not_of to camelCase.
Francesco Chemolli [Wed, 18 Dec 2013 17:53:43 +0000 (18:53 +0100)] 
Rename SBuf::find_first_of and find_first_not_of to camelCase.

11 years agoAdded send_hit and store_miss squid.conf directives
Alex Rousskov [Wed, 18 Dec 2013 17:19:00 +0000 (10:19 -0700)] 
Added send_hit and store_miss squid.conf directives
to control caching of responses using response info.

The existing "cache" directive is checked before Squid has access to the
response and, hence, could not use response-based ACLs such as http_status.
Response-based ACLs may be essential when fine-tuning caching. Squid Bug 3937
(StoreID can lead to 302 infinite loop) is a good use case.

Updated old "cache" directive documentation to provide more information, to
help folks distinguish the three related directives, and to polish for
clarity.

TODO: Support lookup_hit and possibly deprecate/remove "cache".

11 years agoMerge CharacterSet
Francesco Chemolli [Wed, 18 Dec 2013 17:03:15 +0000 (18:03 +0100)] 
Merge CharacterSet

11 years agoReverted buggy change on CharacterSet::operator+=, documentation touches
Francesco Chemolli [Wed, 18 Dec 2013 15:22:06 +0000 (16:22 +0100)] 
Reverted buggy change on CharacterSet::operator+=, documentation touches

11 years agoMerged from trunk
Francesco Chemolli [Wed, 18 Dec 2013 14:07:05 +0000 (15:07 +0100)] 
Merged from trunk

11 years agoAdd unit tests for method parsing update
Amos Jeffries [Wed, 18 Dec 2013 03:00:01 +0000 (19:00 -0800)] 
Add unit tests for method parsing update

11 years agoFix missing include in rev.13186
Amos Jeffries [Wed, 18 Dec 2013 00:48:33 +0000 (16:48 -0800)] 
Fix missing include in rev.13186

11 years agoImproved CharacterSet documentation.
Francesco Chemolli [Tue, 17 Dec 2013 17:28:53 +0000 (18:28 +0100)] 
Improved CharacterSet documentation.

11 years agoMerged from trunk
Francesco Chemolli [Tue, 17 Dec 2013 17:05:17 +0000 (18:05 +0100)] 
Merged from trunk

11 years agoUsing std::copy_if for CharacterSet::operator +=
Francesco Chemolli [Tue, 17 Dec 2013 17:02:51 +0000 (18:02 +0100)] 
Using std::copy_if for CharacterSet::operator +=

11 years agoClarified documentatio for CharacterSet; moved CharacterSet::add and constructor...
Francesco Chemolli [Tue, 17 Dec 2013 15:58:52 +0000 (16:58 +0100)] 
Clarified documentatio for CharacterSet; moved CharacterSet::add and constructor to .cc file

11 years agoMove CharacterSet::operator += to .cc file; change SBuf::find_first_not_of to match STL
Francesco Chemolli [Tue, 17 Dec 2013 10:19:44 +0000 (11:19 +0100)] 
Move CharacterSet::operator += to .cc file; change SBuf::find_first_not_of to match STL

11 years agoHTTP/1.1: method names are case-sensitive
Amos Jeffries [Tue, 17 Dec 2013 09:16:51 +0000 (02:16 -0700)] 
HTTP/1.1: method names are case-sensitive

RFC 2616 states that method names are case sensitive, but the Squid
parser has been accepting them case-insensitive.

Enforce case-sensitive behaviour when performing strict HTTP parse.

NOTE: avoid HTTP_VIOLATIONS since there is no normative MUST/SHOULD
involved in the specification texts.

11 years agoBug 3980: FATAL ERROR due to max_user_ip -s option
Christos Tsantilas [Tue, 17 Dec 2013 07:12:55 +0000 (00:12 -0700)] 
Bug 3980: FATAL ERROR due to max_user_ip -s option

11 years agoMoved CharacterSet's backing storage to std::vector<uint8_t> to gain speed at the...
Francesco Chemolli [Mon, 16 Dec 2013 21:58:50 +0000 (22:58 +0100)] 
Moved CharacterSet's backing storage to std::vector<uint8_t> to gain speed at the expense of space.
Improved CharacterSet's constructor
Made CharacterSet's name parameter optional with default value.

11 years agoMoved CharacterSet as forward-declaration in SBuf.h
Francesco Chemolli [Sun, 15 Dec 2013 12:48:01 +0000 (13:48 +0100)] 
Moved CharacterSet as forward-declaration in SBuf.h

11 years agoImplemented CharacterSet-based SBuf::find_first_of and find_first_not_of
Francesco Chemolli [Sun, 15 Dec 2013 11:47:07 +0000 (12:47 +0100)] 
Implemented CharacterSet-based SBuf::find_first_of and find_first_not_of

11 years agoSilence SBufDetailedStats stubs
Francesco Chemolli [Sun, 15 Dec 2013 09:28:50 +0000 (10:28 +0100)] 
Silence SBufDetailedStats stubs

11 years agoMerge SBufList
Francesco Chemolli [Sun, 15 Dec 2013 09:28:18 +0000 (10:28 +0100)] 
Merge SBufList

11 years agoClarified comment in SBufAlgos.h, improved coding standards adherence
Francesco Chemolli [Sat, 14 Dec 2013 15:58:04 +0000 (16:58 +0100)] 
Clarified comment in SBufAlgos.h, improved coding standards adherence

11 years agoFix linker errors "relocation R_X86_64_32 against .rodata"
Amos Jeffries [Thu, 12 Dec 2013 09:41:39 +0000 (01:41 -0800)] 
Fix linker errors "relocation R_X86_64_32 against .rodata"

... "can not be used when making a shared object; recompile with -fPIC"

Caused by some libraries built without libtool in certain environments.
NP: there are other libraries in Squid built without libtool but they
    appear not to be having these linker issues at this time.

Also, fixes "undefined symbol eui64_aton" uncovered by these changes.

11 years agoRegression in URL helper API
Amos Jeffries [Wed, 11 Dec 2013 11:12:43 +0000 (03:12 -0800)] 
Regression in URL helper API

The backward compatibility logics in redirect.cc are not working as
intended on redirection URLs due to the presence of '=' in the URL and
how the key=value name parsing is performed.

A typical redirection URL looks like:
  http://example.com/?url=http://www.example.net/

and 3.4 has a parser that splits tokens at '=' unconditionally and then
passes the bits as a key and value to the redirector logics which
complains that it does not understand the answer of the URL redirector.
Or treats is an an unknown key=value with no redirection URL.

Either case is handled as a no-redirection result from the helper.

This limits the key names to alphanumeric, hyphen and underscore
characters. Valid URL responses contain characters outside this set and
should no longer be interpreted as keys regardless of the '=' character.

11 years agoFix missing test stub in rev.13178
Amos Jeffries [Wed, 11 Dec 2013 23:41:49 +0000 (12:41 +1300)] 
Fix missing test stub in rev.13178

11 years agoBug 3806: Caching responses with Vary header
Alex Rousskov [Wed, 11 Dec 2013 22:44:59 +0000 (11:44 +1300)] 
Bug 3806: Caching responses with Vary header

11 years agoSet sslcrtvalidator_children concurrency option default value to 1
Christos Tsantilas [Wed, 11 Dec 2013 21:50:06 +0000 (23:50 +0200)] 
Set sslcrtvalidator_children concurrency option default value to 1

11 years ago%tS logformat code, part3
Christos Tsantilas [Mon, 9 Dec 2013 16:54:56 +0000 (18:54 +0200)] 
%tS logformat code, part3

Fix build when GCC 4,4.3 used

11 years agoPrep for 3.4.1
Amos Jeffries [Mon, 9 Dec 2013 01:17:53 +0000 (18:17 -0700)] 
Prep for 3.4.1