]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 years agoMerged from trunk r12948.
Alex Rousskov [Thu, 15 Aug 2013 22:09:07 +0000 (16:09 -0600)] 
Merged from trunk r12948.

12 years agoRegression Bug 3077: off-by-one error in Digest header decoding
Jan Sievers [Thu, 15 Aug 2013 21:28:14 +0000 (15:28 -0600)] 
Regression Bug 3077: off-by-one error in Digest header decoding

This is a regression in the 3.2 and later version of the original bug
fix patch.

The effect is that all attributes are treated as quoted-string values
with unescaping performed. This ends with credentials wrongly being
rejected as invalid.

12 years agoEnsure that the SQUID_BUILD_INFO macro is always defined
Francesco Chemolli [Mon, 12 Aug 2013 16:53:56 +0000 (18:53 +0200)] 
Ensure that the SQUID_BUILD_INFO macro is always defined

12 years agoDisplay Build-Info in cache manager info report
Amos Jeffries [Fri, 9 Aug 2013 03:06:52 +0000 (21:06 -0600)] 
Display Build-Info in cache manager info report

This info can be quite useful for tracking which patched build of Squid
is being used to produce the report.

12 years agoRegister Http2-Settings header
Amos Jeffries [Wed, 7 Aug 2013 03:18:08 +0000 (15:18 +1200)] 
Register Http2-Settings header

This header ia a hop-by-hop request-only header and requires stripping
by intermediaries which do not support HTTP/2.0 in Upgrade feature.

We register it now to ensure the stripping occurs even if broken clients
omit it from the Connection header list.

12 years agoFix configure parsing IP/domain directives
Amos Jeffries [Sat, 3 Aug 2013 07:57:44 +0000 (19:57 +1200)] 
Fix configure parsing IP/domain directives

Squid would semi-silently accept invalid IP address or hostname in some
directives which required them (eg wccp_router) and use the magic
IP_ANYADDR value. This change makes configure halt with a FATAL error
instead.

 Detected by Coverity Scan. Issue 1057286.

12 years agoPolish: handle NTLM helper returning OK without user= value
Amos Jeffries [Sat, 3 Aug 2013 07:23:53 +0000 (19:23 +1200)] 
Polish: handle NTLM helper returning OK without user= value

Prevent crash by treating this case as an error and failed authentication

  Detected by Coverity Scan. Issue 1020656.

12 years agoFix typo in rev.12972
Amos Jeffries [Sat, 3 Aug 2013 06:16:46 +0000 (18:16 +1200)] 
Fix typo in rev.12972

12 years agoFix memory leak in refresh_pattern parsing
Amos Jeffries [Sat, 3 Aug 2013 04:24:06 +0000 (16:24 +1200)] 
Fix memory leak in refresh_pattern parsing

Occurs when refresh_pattern is configure with invalid regex pattern.

 Detected by Coverity Scan. Issue 1058882.

12 years agoCleanup: initialize all member of AnyP::PortCfg
Amos Jeffries [Sat, 3 Aug 2013 04:15:04 +0000 (16:15 +1200)] 
Cleanup: initialize all member of AnyP::PortCfg

  Detected by Coverity Scan. Issue 1058883.

12 years agoAdd dns_multicast_local to control mDNS operation
Amos Jeffries [Thu, 1 Aug 2013 20:45:56 +0000 (08:45 +1200)] 
Add dns_multicast_local to control mDNS operation

Enable admin control over whether mDNS operates or not. Set the default
to OFF due to .arpa reverse-DNS requests causing a rise in traffic from
this feature even on networks without mDNS responders setup.

Also, polish cachemgr idns report to show for queued queries which
resolver type and query the entry is involving. mDNS can cause a queue
to exist as some lookups timeout on the mDNS resolvers.

12 years agoImproved checks on SBuf::*Size methods
Francesco Chemolli [Thu, 1 Aug 2013 09:07:53 +0000 (11:07 +0200)] 
Improved checks on SBuf::*Size methods
Improved detection of vsnprintf's not-well-defined behavior.

12 years agoTightened size checks in reserveSpace, reserveCapacity and rawSpace
Francesco Chemolli [Wed, 31 Jul 2013 16:11:54 +0000 (18:11 +0200)] 
Tightened size checks in reserveSpace, reserveCapacity and rawSpace

12 years agoImproved SBuf::appendf() readability and correctness.
Francesco Chemolli [Wed, 31 Jul 2013 12:17:23 +0000 (14:17 +0200)] 
Improved SBuf::appendf() readability and correctness.
Clarified documentation.
Added SBuf::spaceSize()
Fixed display result in appendf() unit test.

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

12 years agoPrevented STORE_DISK_CLIENT assertions for aborted entries. Polished code.
Alex Rousskov [Tue, 30 Jul 2013 17:10:57 +0000 (11:10 -0600)] 
Prevented STORE_DISK_CLIENT assertions for aborted entries. Polished code.

To prevent store_client.cc:445: "STORE_DISK_CLIENT == getType()" assertions,
rewrote the storeClientNoMoreToSend() function so that it does not send a
STORE_MEM_CLIENT to read from disk. Used this opportunity to polish this
negative function code and convert it into a positive method.

Documented known (and mostly old) StoreEntry::storeClientType() problems.

12 years agoSync with newest OpenSSL error codes
Christos Tsantilas [Tue, 30 Jul 2013 15:19:27 +0000 (18:19 +0300)] 
Sync with newest OpenSSL error codes

This patch updates Squid list of errors to handle the ones available in newer
OpenSSL versions.

This is a Measurement Factory project

12 years agoSpecialize SBuf::reserveSpace and reserveCapacity functions to provide guarantee...
Francesco Chemolli [Tue, 30 Jul 2013 09:43:24 +0000 (11:43 +0200)] 
Specialize SBuf::reserveSpace and reserveCapacity functions to provide guarantee of single store ownership.
Tune SBuf::rawSpace() to take over from reserve* for the optimization role preveiously played by reserve*.
Adjust documentation and callers.

12 years agoFix debugs when refresh_pattern is missing the regex pattern
Amos Jeffries [Tue, 30 Jul 2013 00:44:04 +0000 (18:44 -0600)] 
Fix debugs when refresh_pattern is missing the regex pattern

This is a very rare situation and may not be completely required. But it
did hinder debugging of refresh_pattern when the regex field token was
broken by parser updates.

12 years agoFix 'ERROR: A percentage value is missing.'
Amos Jeffries [Mon, 29 Jul 2013 17:34:48 +0000 (11:34 -0600)] 
Fix 'ERROR: A percentage value is missing.'

This usage of strtok() appears to have been omitted from rev.12949

12 years agoBetter support for things with shared locks that can be opened many times,
Alex Rousskov [Mon, 29 Jul 2013 00:46:55 +0000 (18:46 -0600)] 
Better support for things with shared locks that can be opened many times,
such as Ipc::StoreMap entries. Maintain a lock counter instead of boolean
opened flag.

Better support for things with multipart IDs
such as Ipc::StoreMap entries that have an anchor/inode ID and map name.

Support searching for shared pages (sh_page).

12 years agoRe-enabled on-disk collapsing of entries after fixing related code.
Alex Rousskov [Mon, 29 Jul 2013 00:43:55 +0000 (18:43 -0600)] 
Re-enabled on-disk collapsing of entries after fixing related code.

Since we started writing partial entries, we cannot rely on negative sidNext
marking the end of the slice/write sequence. Added a WriteRequest::eof field
to signal that end explicitly.

Do not leak db slices when write fails or IoState is closed before the write
succeeds.

Handle store client requesting an offset we have not stored yet. This might
happen for collapsed hits (and also if the client is buggy). May need more
work to slow the reader down.

Do not update various shared stats until the corresponding slot is written.

12 years agoRelaxed asserts because hits reading collapsed entries may have zero swap_file_sz.
Alex Rousskov [Mon, 29 Jul 2013 00:33:43 +0000 (18:33 -0600)] 
Relaxed asserts because hits reading collapsed entries may have zero swap_file_sz.

12 years agoImproved STORE_MEM_CLIENT detection.
Alex Rousskov [Mon, 29 Jul 2013 00:27:23 +0000 (18:27 -0600)] 
Improved STORE_MEM_CLIENT detection.

IN_MEMORY mem_status does not guarantee that the entore object is in the
memory cache. We may be just loading it from a shared memrory cache, and
loading may fail. We may have nibbled at the entry already (although that may
not be possible, not sure). The whole memory/disk store_client designation
probably needs more work, but the now-removed condition was causing
store_client.cc:445: "STORE_DISK_CLIENT == getType()" assertions.

12 years agoFollowup for the StoreEntry::mayStartSwapOut() fix (branch r12569).
Alex Rousskov [Sun, 28 Jul 2013 22:34:46 +0000 (16:34 -0600)] 
Followup for the StoreEntry::mayStartSwapOut() fix (branch r12569).

Fixed swapout condition after adding swStarted to allow an already started
swapout to continue.

12 years agoPrep for 3.4.0.1
Amos Jeffries [Sun, 28 Jul 2013 22:25:20 +0000 (16:25 -0600)] 
Prep for 3.4.0.1

12 years agoRemoving a shared cache entry w/o slices does not count as successful purging
Alex Rousskov [Sun, 28 Jul 2013 01:13:57 +0000 (19:13 -0600)] 
Removing a shared cache entry w/o slices does not count as successful purging
because all callers need a new slice, not an available anchor position.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 28 Jul 2013 00:12:51 +0000 (18:12 -0600)] 
SourceFormat Enforcement

12 years agoImprioved sane rock store entry detection to avoid rebuilding coredumps
Alex Rousskov [Sat, 27 Jul 2013 18:44:31 +0000 (12:44 -0600)] 
Imprioved sane rock store entry detection to avoid rebuilding coredumps
due to out-of-range slot IDs.

12 years agoPrevent premature swapout aborts when the last local entry reader goes away.
Alex Rousskov [Sat, 27 Jul 2013 17:29:25 +0000 (11:29 -0600)] 
Prevent premature swapout aborts when the last local entry reader goes away.

12 years agoKeep anchor.basics.swap_file_sz in sync with slice sizes.
Alex Rousskov [Sat, 27 Jul 2013 17:19:29 +0000 (11:19 -0600)] 
Keep anchor.basics.swap_file_sz in sync with slice sizes.

The old code updated anchor.basics.swap_file_sz _after_ copying all of the
available data into shared memory. An exception in the copying loop (e.g., the
map is out of available slots) could prevent that update. For another worker,
the entry would then appear to be fully completed (no writer, last slice size
stable, and last slice poiner is -1) and that worker would assert due to
anchor.basics.swap_file_sz mismatching the sum of slice sizes.

12 years agoHandle infinite certificate validation loops caused by OpenSSL bug #3090.
Christos Tsantilas [Sat, 27 Jul 2013 13:37:29 +0000 (16:37 +0300)] 
Handle infinite certificate validation loops caused by OpenSSL bug #3090.

If OpenSSL is stuck in a validation loop, Squid breaks the loop and triggers a
new custom SQUID_X509_V_ERR_INFINITE_VALIDATION SSL validation error. That
error cannot be bypassed using sslproxy_cert_error because to break the loop
Squid has to tell OpenSSL that the certificate is invalid, which terminates
the SSL connection.

Validation loops exceeding SQUID_CERT_VALIDATION_ITERATION_MAX iterations
are deemed infinite. That macro is defined to be 16384, but that default can
be overwritten using CPPFLAGS.

This is a Measurement Factory project

12 years agoDecoupled reserveCapacity from reserveSpace.
Francesco Chemolli [Fri, 26 Jul 2013 15:28:41 +0000 (17:28 +0200)] 
Decoupled reserveCapacity from reserveSpace.

12 years agoMerged from trunk
Francesco Chemolli [Fri, 26 Jul 2013 12:49:53 +0000 (14:49 +0200)] 
Merged from trunk

12 years agoFix missing bits of rev.12961
Amos Jeffries [Fri, 26 Jul 2013 11:26:04 +0000 (05:26 -0600)] 
Fix missing bits of rev.12961

12 years agoTied more closely SBuf and MemBlob size_type
Francesco Chemolli [Fri, 26 Jul 2013 09:20:09 +0000 (11:20 +0200)] 
Tied more closely SBuf and MemBlob size_type
Better compliance with standards
Improved SBuf documentation
Improved adherence to std::string method signatures
Improved \0-cleanliness
Removed some methods taking std::string arguments to avoid double data copies,
  documented alternate patterns
Implemented cmp and caseCmp shortcuts
Cleaned-up some methods' implementations after Alex Rousskov's suggestions
Improved unit tests' cleanliness by making more effective use of cppunit macros
Implemented more unit tests, better coverage for \0-cleanliness

12 years agoDocs: Update http(s)_port protocol= details
Amos Jeffries [Fri, 26 Jul 2013 05:21:29 +0000 (23:21 -0600)] 
Docs: Update http(s)_port protocol= details

12 years agoUpdate the http(s)_port directives protocol= parameter
Amos Jeffries [Fri, 26 Jul 2013 02:06:25 +0000 (20:06 -0600)] 
Update the http(s)_port directives protocol= parameter

... to use AnyP::ProtocolVersion for internal storage instead of opaque
string text.

This both limits the possible parameter values to one of HTTP, HTTP/1.1,
HTTPS or HTTPS/1.1 and ensures that URLs generated from that protocol
parameter value are http:// and https:// URL.
Other values will cause Squid to abort.

12 years agoRelease Notes: fix typo in ./configure options
Amos Jeffries [Thu, 25 Jul 2013 13:59:35 +0000 (07:59 -0600)] 
Release Notes: fix typo in ./configure options

12 years agoMake GCC 4.8 happy with libip code
Amos Jeffries [Thu, 25 Jul 2013 13:06:58 +0000 (07:06 -0600)] 
Make GCC 4.8 happy with libip code

Invalid casting seems to confuse the ABI generator and results in
illegal instruction faults when the unit tests is run.
The class API is already const-correct so there is no need for the cast
to occur, and it should not be done on a non-pointer type anyway.

Also, fixes a missing "struct" type identifier found along the way.

12 years agoFix assert with side effects in ServerStateData::handleAdaptedHeader
Nathan Hoad [Thu, 25 Jul 2013 07:21:54 +0000 (01:21 -0600)] 
Fix assert with side effects in ServerStateData::handleAdaptedHeader

setConsumerIfNotLate conditionally schedules some async calls, so the
call definitely shouldn't be removed by the precompiler.

12 years agoFix mgr:info report 'Largest file desc currently in use' with SMP
Amos Jeffries [Thu, 25 Jul 2013 03:42:06 +0000 (21:42 -0600)] 
Fix mgr:info report 'Largest file desc currently in use' with SMP

The biggest FD in use should not be the sum of biggest FD in each worker,
but the maximum across all workers.

12 years agoDisconnect StoreEntries before deleting their memory objects.
Alex Rousskov [Wed, 24 Jul 2013 21:48:45 +0000 (15:48 -0600)] 
Disconnect StoreEntries before deleting their memory objects.

The new cleanup order helps identify the write Rock entry state (reading or
writing) and avoid assertions related to state identification bugs (such
as unlocking a writing entry for reading).

Similar to the memory cache code, we should not disconnect disk entries during
shutdown because Store::Root() may be missing by then.

12 years agoAvoid !writeableAnchor_ assertions when Squid shuts down.
Alex Rousskov [Wed, 24 Jul 2013 21:45:02 +0000 (15:45 -0600)] 
Avoid !writeableAnchor_ assertions when Squid shuts down.

A shutting down Squid deletes locked StoreEntry objects, which may trigger
deletion of Rock::IoState that is still writing to disk. We should fix the
shutdown sequence. Meanwhile, the Rock::IoState code does not need to mislead
admins with an assert.

12 years agoMerged from trunk
Francesco Chemolli [Wed, 24 Jul 2013 16:14:23 +0000 (18:14 +0200)] 
Merged from trunk

12 years agoAvoid invalid fileno assertion when purging victim becomes negative on overflows.
Alex Rousskov [Mon, 22 Jul 2013 18:02:42 +0000 (12:02 -0600)] 
Avoid invalid fileno assertion when purging victim becomes negative on overflows.

Overflows are expected by design, but we should not allow the value to become
negative.

12 years agoFixed StoreEntry::mayStartSwapOut() logic to handle terminated swapouts.
Alex Rousskov [Mon, 22 Jul 2013 17:04:00 +0000 (11:04 -0600)] 
Fixed StoreEntry::mayStartSwapOut() logic to handle terminated swapouts.

StoreEntry::mayStartSwapOut() should return true if a swapout can start. If
swapout was started earlier but then terminated for some reason (setting sio
to nil), the method should not return true. Checking swap_status ==
SWAPOUT_DONE does not work reliably because the status may be reset to
SWAPOUT_NONE in some cases (and the check was too late anyway). Checking
decision == swPossible does not work at all because while swapout start was
possible at some point, it is no longer possible after we started swapping
out.

Added MemObject::SwapOut::swStarted to detect started swapouts reliably.

12 years agoDo not segfault on context debugging when destroying MemObject without store ID.
Alex Rousskov [Mon, 22 Jul 2013 17:00:03 +0000 (11:00 -0600)] 
Do not segfault on context debugging when destroying MemObject without store ID.

12 years agoBranch 3.4.0.0 and disable snapshots 3.1 and 3.2
Automatic source maintenance [Mon, 22 Jul 2013 09:22:09 +0000 (03:22 -0600)] 
Branch 3.4.0.0 and disable snapshots 3.1 and 3.2

12 years agoRelease Notes: fix typo
Amos Jeffries [Mon, 22 Jul 2013 05:15:37 +0000 (23:15 -0600)] 
Release Notes: fix typo

12 years agoRelease notes for multicast DNS support
Amos Jeffries [Mon, 22 Jul 2013 02:13:50 +0000 (20:13 -0600)] 
Release notes for multicast DNS support

12 years agoRelease notes for rev.12945
Amos Jeffries [Mon, 22 Jul 2013 01:57:39 +0000 (19:57 -0600)] 
Release notes for rev.12945

12 years agoFix return value of ConfigParser::strtokFile()
Amos Jeffries [Mon, 22 Jul 2013 01:26:09 +0000 (19:26 -0600)] 
Fix return value of ConfigParser::strtokFile()

12 years agoRelease Notes: document squid.conf quoting changes
Amos Jeffries [Sun, 21 Jul 2013 23:23:13 +0000 (17:23 -0600)] 
Release Notes: document squid.conf quoting changes

12 years agoRelease Notes: update squid.conf directive status
Amos Jeffries [Sun, 21 Jul 2013 23:02:09 +0000 (17:02 -0600)] 
Release Notes: update squid.conf directive status

12 years agoQuoted values in squid.conf
Christos Tsantilas [Sun, 21 Jul 2013 19:24:35 +0000 (22:24 +0300)] 
Quoted values in squid.conf

This patch :
  - adds support for quoted values in the entire squid.conf
  - warn about or prohibit values that can no longer be interpreted as
    either quoted strings or simple tokens
  - support parameters("/path/to/file.name") syntax to load external
    configuration files
  - Checks if macros allowed in "double quoted" values.
  - replaces the strtok() calls with calls to the new ConfigParser::NextToken()
  - modify strtokFile to use new ConfigParser::NextToken()
  - Add the new configuration_includes_quoted_values configuration option, to
    control the squid parser behaviour. If set to on Squid will recognize each
    "quoted string" after a configuration directive as a single parameter

This is a Measurement Factory project

12 years agoBug 3879: assertion failed ConnStateData::validatePinnedConnection
Martin Stolle [Thu, 18 Jul 2013 05:02:23 +0000 (23:02 -0600)] 
Bug 3879: assertion failed ConnStateData::validatePinnedConnection

12 years agoDocumented space() methods to explain why bugs like 3869 keep happening.
Alex Rousskov [Thu, 18 Jul 2013 02:07:31 +0000 (20:07 -0600)] 
Documented space() methods to explain why bugs like 3869 keep happening.

Hopefully we will not repeat these mistakes with StringNG.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 16 Jul 2013 00:13:03 +0000 (18:13 -0600)] 
SourceFormat Enforcement

12 years agoLog TOS and Netfilter marks set by Squid
Christos Tsantilas [Mon, 15 Jul 2013 15:47:00 +0000 (18:47 +0300)] 
Log TOS and Netfilter marks set by Squid

This patch add new logformat codes to log TOS/DSCP values and netfilter marks
for client and server connections. If multiple outgoing connections were used,
the last used connection value logged.
The values printed in hexadecimal form.
The logformat codes are:
   %>tos    Client connection tos mark set by Squid
   %<tos    Server connection tos mark set by Squid
   %>nfmark Client connection netfilter mark set by Squid
   %<nfmark Server connection netfilter mark set by Squid

This patch also modify qos related code to set Comm::Connection::nfmark and
Comm::Connection::tos members in Ip::Qos::setSockNfmark and Ip::Qos::setSockTos
methods. The Comm::Connection members are now set only if the tos and nfmark
set successfuly.

This is a Measurement Factory project

12 years agoBug 2287: Better fix for unsupported HTP version handling
Amos Jeffries [Mon, 15 Jul 2013 13:41:51 +0000 (07:41 -0600)] 
Bug 2287: Better fix for unsupported HTP version handling

RFC 2616 section 10.5.6 is more specifically about MAJOR versions.
Remove the criterion limiting 1.x minor version numbers.

12 years agoReload into If-None-Match
Christos Tsantilas [Mon, 15 Jul 2013 07:49:43 +0000 (10:49 +0300)] 
Reload into If-None-Match

This patch sends an If-None-Match  request, when we need to re-validate
if a cached object which has a strong ETag is still valid.

This is also done in the cases an HTTP client request contains HTTP
headers prohibiting a from-cache response (i.e., a "reload" request).
The use of If-None-Match request in this context violates RFC 2616 and
requires using reload-into-ims option within refresh_pattern squid.conf
directive.

The exact definition of a "reload request" and the adjustment/removal of
"reload" headers is the same as currently used for reload-into-ims
option support. This patch is not modifying that code/logic, just adding
an If-None-Match header in addition to the IMS header that Squid already
adds.

This is a Measurement Factory Project

12 years agoFix stupid typo in rev.12941
Amos Jeffries [Sun, 14 Jul 2013 03:45:23 +0000 (21:45 -0600)] 
Fix stupid typo in rev.12941

12 years agoFix external ACL user:pass detail logging after adaptation
Nathan Hoad [Sun, 14 Jul 2013 03:03:53 +0000 (21:03 -0600)] 
Fix external ACL user:pass detail logging after adaptation

When a request is successfully adapted, the external ACL username and
password are now inherited with this patch. This means the
LFT_USER_NAME log token can display the username from an external ACL
if available, for adapted requests.

The HttpRequest will inherit the password for good measure as well -
while none too useful, it seems strange to inherit the username but
not the password.

12 years agoFix assert() with side effects
Amos Jeffries [Sun, 14 Jul 2013 03:00:32 +0000 (21:00 -0600)] 
Fix assert() with side effects

assert() may be completely removed by precompiler when optimizing. Such
that the code conditional never gets run.

12 years agoPrep for 3.3.8 and 3.2.13
Amos Jeffries [Sat, 13 Jul 2013 13:08:28 +0000 (07:08 -0600)] 
Prep for 3.3.8 and 3.2.13

12 years agoBetter handling of strange port values in Host:
Amos Jeffries [Sat, 13 Jul 2013 12:19:45 +0000 (00:19 +1200)] 
Better handling of strange port values in Host:

We can do better than just producing errors about invalid port details
and treatign it as port-0.
We can instead undo the port separation and pass it through as part of
the host name to be verified with the default port number properly
assumed.

12 years agoBug 3869: assertion failed: MemBuf.cc:272: size < capacity
Amos Jeffries [Fri, 12 Jul 2013 16:08:09 +0000 (10:08 -0600)] 
Bug 3869: assertion failed: MemBuf.cc:272: size < capacity

12 years agoPrep for 3.2.12 and 3.3.7
Amos Jeffries [Thu, 11 Jul 2013 04:38:47 +0000 (22:38 -0600)] 
Prep for 3.2.12 and 3.3.7

12 years agoProtect against buffer overrun in DNS query generation
Nathan Hoad [Wed, 10 Jul 2013 12:38:36 +0000 (06:38 -0600)] 
Protect against buffer overrun in DNS query generation

see SQUID-2013:2.

This bug has been present as long as the internal DNS component however
most code reaching this point is passing through URL validation first.
With Squid-3.2 Host header verification using DNS directly we may have
problems.

12 years agoUse Rock::IoState::writeableAnchor_ to detect rock entries open for writing.
Alex Rousskov [Wed, 10 Jul 2013 00:41:01 +0000 (18:41 -0600)] 
Use Rock::IoState::writeableAnchor_ to detect rock entries open for writing.

Just e.mem_obj->swapout.sio presence is not reliable enough because we
may switch from writing to reading while the [writing] sio is still around.

More explicitly disabled on-disk collapsing of entries. The relevant code is
unstable under load [at least when combined with memory caching]. We were not
calling Ipc::StoreMap::startAppending() before so we probably did not fully
disk-collapsed entries before these temporary changes.

Added an XXX to mark an assert() that may fail if we allow on-disk collapsing.

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

12 years agoAdded a script to extract store entry(ies) debugging from cache.log.
Alex Rousskov [Tue, 9 Jul 2013 23:01:38 +0000 (17:01 -0600)] 
Added a script to extract store entry(ies) debugging from cache.log.

12 years agoMemStore::unlink() should not assume that the entry is "linked"
Alex Rousskov [Tue, 9 Jul 2013 22:48:05 +0000 (16:48 -0600)] 
MemStore::unlink() should not assume that the entry is "linked"
because the caller should not be responsible for knowing how that linking works.

12 years agoSynced collapsed forwarding in rock store with working shared mem cache code.
Alex Rousskov [Tue, 9 Jul 2013 22:14:51 +0000 (16:14 -0600)] 
Synced collapsed forwarding in rock store with working shared mem cache code.

12 years agoRelease Notes: more 3.4 documentation
Amos Jeffries [Tue, 9 Jul 2013 13:29:05 +0000 (07:29 -0600)] 
Release Notes: more 3.4 documentation

12 years agoAdd storeid_file_rewrite helper
Alan Mizrahi [Tue, 9 Jul 2013 11:15:51 +0000 (05:15 -0600)] 
Add storeid_file_rewrite helper

Based on work by Eliezer Croitoru <eliezer@ngtech.co.il>

This program acts as a Store-ID helper program, rewriting URLs passed
by Squid into storage-ids that can be used to achieve better caching
for websites that use different URLs for the same content.

It takes a text file with two tab separated columns.
 Column 1: Regular expression to match against the URL
 Column 2: Rewrite rule to generate a Store-ID

Rewrite rules are matched in the same order as they appear in the file.
So for best performance, sort it in order of frequency of occurrence.

12 years agoSupport IPv6 NAT interception on Linux
Alexis Robert [Tue, 9 Jul 2013 10:04:39 +0000 (22:04 +1200)] 
Support IPv6 NAT interception on Linux

NAT support has been included for IPv6 in Linux 3.7 (along with
REDIRECT/DNAT rules), as well as IP6T_SO_ORIGINAL_DST in Linux 3.8.
Add support for transparent proxies over IPv6.

There is a bug in linux/netfilter_ipv6/ip6_tables.h on C++ compilers,
the bug report and patch to fix it can be found at
  https://lkml.org/lkml/2012/9/30/146.
It is only used for the constant IP6T_SO_ORIGINAL_DST. We attempt to use
the official header whenever possible but if it is detected missing or
broken we define our own version of the option.

IPv6 is now permitted on any http_port or https_port in squid.conf
however on older Linux systems and Unix systems without the required NAT
support Squid will fail when accepting the traffic.

Also, this removes the blocker checks preventing BSD systems using NAT
interception on IPv6 ports. Several version of PF have long since
supported IPv6 NAT operations although it was discouraged, such support
is not easily detected though so results WILL vary by operating system.

12 years agoBug 3876: mDNS support segfault when using --disable-ipv6
Amos Jeffries [Tue, 9 Jul 2013 05:31:57 +0000 (17:31 +1200)] 
Bug 3876: mDNS support segfault when using --disable-ipv6

When IPv6 is disabled the mDNS IPv6 multicast group gets rejected by
idnsAddnameserver() resulting in invalid pointers for the remaining
mDNS NS setup operations.

Convert the hard-coded mDNS nameserver count to dynamic global count and
elide the relevant NS when IPv6 support disabled.

12 years agoMade GCC v4.4.6 happier: "invalid conversion from long int to StoreEntry*"
Alex Rousskov [Mon, 8 Jul 2013 22:52:11 +0000 (16:52 -0600)] 
Made GCC v4.4.6 happier: "invalid conversion from long int to StoreEntry*"

12 years agoCleanup: remove duplicate includes
Amos Jeffries [Sat, 6 Jul 2013 15:11:43 +0000 (09:11 -0600)] 
Cleanup: remove duplicate includes

Remove duplicate includes of system files already pulled in by compat/types.h

12 years agoMerged changes since Apr 2013 review
Francesco Chemolli [Thu, 4 Jul 2013 21:25:10 +0000 (23:25 +0200)] 
Merged changes since Apr 2013 review

12 years agoRelease Notes: initial 3.4 changelog
Amos Jeffries [Thu, 4 Jul 2013 08:05:33 +0000 (02:05 -0600)] 
Release Notes: initial 3.4 changelog

12 years agoBootstrapped
Automatic source maintenance [Thu, 4 Jul 2013 00:10:48 +0000 (18:10 -0600)] 
Bootstrapped

12 years agoFix build on FreeBSD 9.x platform with clang
Christos Tsantilas [Wed, 3 Jul 2013 17:34:42 +0000 (20:34 +0300)] 
Fix build on FreeBSD 9.x platform with clang

Add the "/usr/local/*" directories to include files  and libraries  search
paths, for clang compiler too.

12 years agoAddressed and updated XXXs and TODOs.
Alex Rousskov [Tue, 2 Jul 2013 22:52:31 +0000 (16:52 -0600)] 
Addressed and updated XXXs and TODOs.

12 years agoBroadcast mem-cache writer departure to transient readers (in more/all cases).
Alex Rousskov [Tue, 2 Jul 2013 19:23:49 +0000 (13:23 -0600)] 
Broadcast mem-cache writer departure to transient readers (in more/all cases).

Moved transientsAbandon() call to MemStore::disconnect() to make sure we
catch all cases where a mem-cache writer stops updating the cache entry.
Transient readers need to know so that they do not get stuck when a writer
disappears.

transientsAbandon() needs StoreEntry so MemStore::disconnect requires one now.

12 years agoDo not become a store_client for entries that are not backed by Store.
Alex Rousskov [Mon, 1 Jul 2013 19:59:32 +0000 (13:59 -0600)] 
Do not become a store_client for entries that are not backed by Store.

If we ignore cache backing when becoming a store client, then
StoreEntry::storeClientType() is going to make us a DISK_CLIENT by default.
If there is no disk cache or it cannot be used for our entry, we will assert
in store_client constructor. Prevent those assertions by checking earlier in
StoreEntry::validToSend().

12 years agoFTP gateway: web browsers compatibility fix.
Dmitry Kurochkin [Mon, 1 Jul 2013 12:38:32 +0000 (16:38 +0400)] 
FTP gateway: web browsers compatibility fix.

Do not forward server greeting to client as a preliminary reply
because it may confuse web browsers.

12 years agoFTP gateway: interception mode for ftp_port.
Dmitry Kurochkin [Mon, 1 Jul 2013 12:00:20 +0000 (16:00 +0400)] 
FTP gateway: interception mode for ftp_port.

12 years agoAdd mem-cache and transient store entry details in mgr:objects output.
Alex Rousskov [Mon, 1 Jul 2013 02:26:35 +0000 (20:26 -0600)] 
Add mem-cache and transient store entry details in mgr:objects output.

12 years agoSeveral fixes and improvements to help collapsed forwarding work reliably:
Alex Rousskov [Mon, 1 Jul 2013 02:25:50 +0000 (20:25 -0600)] 
Several fixes and improvements to help collapsed forwarding work reliably:

Removed ENTRY_CACHABLE. AFAICT, it was just negating RELEASE_REQUEST AFAICT.

Broadcast transients index instead of key because key may become private.

Squid uses private keys to resolve store_table collisions (among other
things). Thus, a public entry may become private at any time, at any worker.
Using keys results in collapsed entries getting stuck waiting for an update.
The transients index remains constant and can be used for reliable
synchronization.

Using transient index, however, requires storing a pointer to the transient
entry corresponding to that index. Otherwise, there is no API to find the
entry object when a notification comes: Store::Root().get() needs a key.

Mark an entry for release when setting its key from public to private. The old
code was only logging SWAP_LOG_DEL, but we now need to prevent requests in
other workers from collapsing on top of a now-private cache entry. In many
cases, such an entry is in trouble (but not all cases because private keys are
also used for store_table collision resolution).

Fixed syncing of abandoned entries.

Prevent new requests from collapsing on writer-less transient entries.

12 years agoBug 3297: Fix openSSL related build failures
Christos Tsantilas [Sun, 30 Jun 2013 15:54:22 +0000 (18:54 +0300)] 
Bug 3297: Fix openSSL related build failures

- The SSL_CTX_new in newer openSSL releases requires a const
'SSL_METHOD *' argument and in older releases requires non const
'SSL_METHD *' argument. Currently we are trying to identify openSSL
version using the OPENSSL_VERSION_NUMBER macro define but we are failing
to correctly identify all cases.

- sk_OPENSSL_PSTRING_value is buggy in early openSSL-1.0.0? releases
causing compile errors to squid.

This is a Measurement Factory project

12 years agoPrep for 3.3.6
Amos Jeffries [Sun, 30 Jun 2013 08:52:51 +0000 (02:52 -0600)] 
Prep for 3.3.6

12 years agoBug 3762: remove bogus WARNING in cache.log
Amos Jeffries [Sat, 29 Jun 2013 14:43:23 +0000 (08:43 -0600)] 
Bug 3762: remove bogus WARNING in cache.log

The warning is bogus for several reasons:
* it appears with memory-only cache configurations
* it only checks the size of first SwapDir (as seen in bug 3762)
* very large memory spaces are now possible which may make disk appear
  small by comparison.

Its usefulness in detecting memory and disk misconfigurations has long
been almosy nil. Removing this entirey to resolve the bogus noise in
the above mentinoed legitimate configurations.

12 years agoBug 3842: Segfault during connection close in ConnStateData::stopReceiving()
Amos Jeffries [Sat, 29 Jun 2013 11:37:08 +0000 (05:37 -0600)] 
Bug 3842: Segfault during connection close in ConnStateData::stopReceiving()

12 years agoCleanup: Remove last CBDATA_CLASS() macros
Amos Jeffries [Sat, 29 Jun 2013 04:21:47 +0000 (22:21 -0600)] 
Cleanup: Remove last CBDATA_CLASS() macros

Update the final CBDATA_CLASS() macro usages to CBDATA_CLASS2() and
remove the now defunct macro.

12 years agoTightened StoreEntry locking. Fixed entry touching and synchronization code:
Alex Rousskov [Thu, 27 Jun 2013 21:26:57 +0000 (15:26 -0600)] 
Tightened StoreEntry locking. Fixed entry touching and synchronization code:

Tightened StoreEntry locking code to use accessors instead of manipulating the
locking counter directly. Helps with locking bugs detection. Do not consider
STORE_PENDING and SWAPOUT_WRITING entries locked by default because it is
confusing and might even leave zero lock_count but locked() entries in the
global table. Entry users should lock them instead.

StoreController::get() is now the only place where we touch() a store entry.
We used to touch entries every time they were locked, which possibly did not
touch some entries often enough (e.g. during Vary mismatches and such where
the get() entry is discarded) and definitely touched some entries too often
(every time the entry was locked multiple times during the same master
transaction). This addresses a design bug marked RBC 20050104.

Fixed interpretation of IN_MEMORY status. The status means that the store
entry was, at some point, fully loaded into memory. And since we prohibit
trimming of IN_MEMORY entries, it should still be fully loaded. Collapsing
changes started to use IN_MEMORY for partially loaded entries, which helps
detecting entries associated with the [shared] memory cache, but goes against
old Squid code assumptions, triggering assertions.

Handle synchronization of entries the worker is writing. Normally, the writing
worker will not receive synchronization notifications (it will send them) but
a stale notification is possible and should not lead to asserts.  The worker
writing an entry will see a false mem_obj->smpCollapsed.

Do not re-anchor entries that were already anchored, fully loaded (ioDone),
and are now disassociated from the [shared] memory cache.

For shared caching to work reliably, StoreEntry::setReleaseFlag() should mark
cache entries for future release. We should not wait for release() time.
Waiting creates stuck entries because Squid sometimes changes the key from
public to private and collapsed forwarding broadcasts are incapable of
tracking such key changes (but they are capable of detecting entries abandoned
by their writers via the deletion mark in the transients table).

Polished debugging.

12 years agoImproved debugging.
Alex Rousskov [Thu, 27 Jun 2013 21:09:02 +0000 (15:09 -0600)] 
Improved debugging.

12 years agoMade storeKeyText safe for entries that do not have a key set yet.
Alex Rousskov [Thu, 27 Jun 2013 21:04:01 +0000 (15:04 -0600)] 
Made storeKeyText safe for entries that do not have a key set yet.