]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
8 years agorun formatter
Christos Tsantilas [Fri, 13 May 2016 10:27:54 +0000 (13:27 +0300)] 
run formatter

8 years agoFix comment about v23 ciphers
Christos Tsantilas [Tue, 10 May 2016 08:30:52 +0000 (11:30 +0300)] 
Fix comment about v23 ciphers

Also add the RFC links

8 years agoPolishing fixes
Christos Tsantilas [Mon, 9 May 2016 17:19:42 +0000 (20:19 +0300)] 
Polishing fixes

 - Replace Handshake::details pointer with an always-available object
 - Replace Security::ProtocolVersion and its "int" representation in TlsDetails
   and NegotiationHistory classes with the existing Anyp::ProtocolVersion
 - Fix TlsDetails::compressMethod. The clients may send a compression methods
   list with a NULL compression method.
   Rename to TlsDetails::compressionSupported.
 - Other minor fixes.

8 years agoFixed header guard style.
Alex Rousskov [Tue, 3 May 2016 17:33:54 +0000 (11:33 -0600)] 
Fixed header guard style.

8 years agoFixed lack of heartbeat detection.
Alex Rousskov [Tue, 3 May 2016 17:21:39 +0000 (11:21 -0600)] 
Fixed lack of heartbeat detection.

8 years agoOptimization: Spend less CPU and RAM on adjustSSL(). Speed gain: ~5%.
Alex Rousskov [Tue, 3 May 2016 17:18:39 +0000 (11:18 -0600)] 
Optimization: Spend less CPU and RAM on adjustSSL(). Speed gain: ~5%.

Do not store extension types just to iterate over them in adjustSSL().
Check for extension support while parsing instead. Since the list of
OpenSSL-supported extensions is constant (does not depend on the
connection), we do not need to create and index extension storage once
for each TLS connection; we now do it once per worker lifetime instead.

Use std::unordered_set instead of std::list for ciphers. Most real-world
cipher lists probably contain dozens of 2-byte entries, making std::list
storage a poor choice. Unlike TLS extensions, supported ciphers depend
on the connection so we have to store all of them to check whether each
stored cipher is supported for the SSL connection object created later.
Having an O(1) lookup speeds up that last check a lot compared to the
old linear search across all stored ciphers.

Do fast adjustSSL() checks before the longer cipher loop check.

Acknowledge TLS_EMPTY_RENEGOTIATION_INFO_SCSV pseudo cipher support.

Added TLSEXT_TYPE_signature_algorithms(13) and
TLSEXT_TYPE_next_proto_neg(13172) to the list of TLS extensions
supported by OpenSSL and recognized by Squid. Recognizing these
extensions is necessary for adjustSSL() to work in more real-world
cases.

Also sorted TLSEXT_TYPE_* entries and replaced "#if 0" code with a way
to build Squid to recognize more extensions as OpenSSL's list grows.

8 years agoFinalized BinaryTokenizer context handling. Polished.
Alex Rousskov [Mon, 2 May 2016 16:38:05 +0000 (10:38 -0600)] 
Finalized BinaryTokenizer context handling. Polished.

No more funny context fields inside TLS structures. Context is handled
by the parsing code without needlessly storing it long-term.

Hid TLS structures/parsers used exclusively by
Security::HandshakeParser inside security/Handshake.cc to simplify API.

Also skipped unused ServerHello.random (instead of storing it in
TlsDetails::clientRandom) and replaced SQUID_TLS_RANDOM_SIZE macro
with a regular C++ constant.

8 years agoStop parsing SSL records after a fatal SSL Alert.
Alex Rousskov [Sat, 30 Apr 2016 03:38:26 +0000 (21:38 -0600)] 
Stop parsing SSL records after a fatal SSL Alert.

The fatal alert sender should close the connection. Waiting for the next
record is pointless and will obscure the problem when we eventually read
the EOF on the socket.

8 years agoSeparated BinaryTokenizer commits from context debugging. Polished.
Alex Rousskov [Sat, 30 Apr 2016 03:35:46 +0000 (21:35 -0600)] 
Separated BinaryTokenizer commits from context debugging. Polished.

Commits are relatively rare events specific to incremental parsing. Most
parsers are not incremental and do not commit/rollback. However, all
parsers need to debug what they parse. Thus, it was wrong to combine
commits with context debugging.

BinaryTokenizer single-context debugging did not support nested contexts
(such as Hello.version.major) and reported wrong FieldGroup sizes for
some parsed structures. The new BinaryTokenizerContext does not have
these problems and is more general (but still needs more polishing
work).

Also polished many field names, comments, debug messages, and some code.

8 years agoSimplified variable-length vector (our "PStrings") contents extraction.
Alex Rousskov [Fri, 29 Apr 2016 00:45:48 +0000 (18:45 -0600)] 
Simplified variable-length vector (our "PStrings") contents extraction.

Earlier code required the caller to first create a PString object and
then extract its .data field to get to the vector contents as an SBuf.
However, that approach just increased code and logging noise because
that SBuf itself (including SBuf.length()) is all the caller may need!

8 years agoFixed parsing of server-sent SNI.
Alex Rousskov [Fri, 29 Apr 2016 00:27:45 +0000 (18:27 -0600)] 
Fixed parsing of server-sent SNI.

The old code could not handle an empty SNI extension that most servers
send. RFC 6066 prose instructs servers to send empty SNI extensions, and
the formal SNI grammar is apparently client-specific. We are not the
only ones being confused by that because there are severs that send
empty ServerNameLists, which are actually prohibited by the grammar.

8 years agoFixed SNI parsing. The old code could only handle single-name SNI lists.
Alex Rousskov [Thu, 28 Apr 2016 19:12:10 +0000 (13:12 -0600)] 
Fixed SNI parsing. The old code could only handle single-name SNI lists.

... and, hence, failed to parse empty SNI lists with misleading
"needMore" errors.

8 years agoBe careful with parsed TLS handshake details. They may be missing.
Alex Rousskov [Sat, 23 Apr 2016 04:57:06 +0000 (22:57 -0600)] 
Be careful with parsed TLS handshake details. They may be missing.

TODO: Convert HandshakeParser::details pointer into an always-available
object?

8 years agoRemoved HandshakeParser::parseError and hid/renamed its parseDone.
Alex Rousskov [Sat, 23 Apr 2016 04:46:12 +0000 (22:46 -0600)] 
Removed HandshakeParser::parseError and hid/renamed its parseDone.

The presence of two "persistent" parsing outcomes (done and error) was
confusing to the callers: Which one do I check and when? The adjusted
interface uses exceptions for errors and a false parseHandshake() return
value to signal "need more data". This simplifies the API and untangles
the calling code quite a bit.

8 years agoFixed "make distcheck".
Alex Rousskov [Fri, 22 Apr 2016 17:35:53 +0000 (11:35 -0600)] 
Fixed "make distcheck".

8 years agoRemoved unused methods.
Alex Rousskov [Fri, 22 Apr 2016 17:11:54 +0000 (11:11 -0600)] 
Removed unused methods.

8 years agoFixed "make check".
Alex Rousskov [Fri, 22 Apr 2016 16:47:59 +0000 (10:47 -0600)] 
Fixed "make check".

8 years agoCode polishing. No functionality changes.
Alex Rousskov [Fri, 22 Apr 2016 05:17:07 +0000 (23:17 -0600)] 
Code polishing. No functionality changes.

8 years agoDo not allocate TlsDetails until throwing isSslv2Record() returns.
Alex Rousskov [Fri, 22 Apr 2016 04:51:24 +0000 (22:51 -0600)] 
Do not allocate TlsDetails until throwing isSslv2Record() returns.

If isSslv2Record() throws InsufficientInput, then we must re-parse these
first few bytes later. Nil details triggers that parsing.

8 years agoMerged two identical methods together. No functionality changes.
Alex Rousskov [Fri, 22 Apr 2016 03:48:37 +0000 (21:48 -0600)] 
Merged two identical methods together. No functionality changes.

8 years agoLack of data at EOF is a parsing error, not a "need more" condition.
Alex Rousskov [Fri, 22 Apr 2016 00:12:20 +0000 (18:12 -0600)] 
Lack of data at EOF is a parsing error, not a "need more" condition.

Branch changes did not distinguish "need more and can expect more" from
"need more but got everything" situations. When one of the inner parsers
that deal with "complete" buffers failed, it would throw
InsufficientInput exception and the higher level parsing code would
interpret that as a sign that more SSL records/fragments are needed,
resulting in stuck transactions instead of parsing errors.

Unlike parsing errors, stuck transactions cannot be bypassed or ignored
so the difference is important.

8 years agoFixed "unused variable" compilation error.
Alex Rousskov [Fri, 15 Apr 2016 18:03:53 +0000 (12:03 -0600)] 
Fixed "unused variable" compilation error.

8 years agoOptimization/simplification: Do not parse unused challenge in v2 Handshake.
Alex Rousskov [Fri, 15 Apr 2016 17:52:20 +0000 (11:52 -0600)] 
Optimization/simplification: Do not parse unused challenge in v2 Handshake.

Also removed pointless commit() and #if-0d code.

8 years agoRefactored and probably sped up ServerBio reading.
Alex Rousskov [Wed, 13 Apr 2016 05:40:24 +0000 (23:40 -0600)] 
Refactored and probably sped up ServerBio reading.

I could not grok the logic of the ServerBio::read*() methods and
saw strange cache.log message sequences like this:

  | bio.cc(121) read: FD 13 read -1 <= 65535
  | bio.cc(126) read: error: 11 ignored: 1
  | bio.cc(139) readAndBuffer: read -1 bytes
  | bio.cc(266) read: Pass 5 bytes to openSSL as read
  | bio.cc(121) read: FD 13 read -1 <= 65535
  | bio.cc(126) read: error: 11 ignored: 1
  | bio.cc(139) readAndBuffer: read -1 bytes
  | bio.cc(266) read: Pass 4 bytes to openSSL as read

Initially, they looked like we were [incorrectly] subtracting -1 from
some buffer length (read -1, pass 5; read -1, pass 4). Now, I believe
they [just] indicated unnecessary network reads. The fixed sequence
looks similar to this (note no network reads):

  | bio.cc(289) giveBuffered: Pass 5 read bytes to openSSL
  | bio.cc(289) giveBuffered: Pass 4 read bytes to openSSL

The refactored ServerBio code starts in "parsing" state (SSL Hello
parsing is the primary ServerBio functionality). Only when that parsing
is over, ServerBio starts feeding OpenSSL with received bytes. This
internal logic allows us to hide parsing from callers and avoid the
confusing public holdRead API.

8 years agoThe "hold write" conditions are not important enough for debug level 1.
Alex Rousskov [Wed, 13 Apr 2016 05:36:05 +0000 (23:36 -0600)] 
The "hold write" conditions are not important enough for debug level 1.

... and are already reported at lower levels in ServerBio.

I was getting one of this messages for every(?) transaction in Polygraph
tests.

8 years agoFixed SSL server Hello parsing.
Alex Rousskov [Tue, 12 Apr 2016 18:28:03 +0000 (12:28 -0600)] 
Fixed SSL server Hello parsing.

We must parse cipher and compression method before extensions.

Also fixed extensions detection to match RFC 5246 algorithm.

8 years agoRecord SSL client and SSL server details (supported TLS version/requested
Christos Tsantilas [Fri, 8 Apr 2016 10:58:07 +0000 (13:58 +0300)] 
Record SSL client and SSL server details (supported TLS version/requested
TLS version) for fast-sni branch

Currently the fast-SNI-peek branch does not parse SSL client hello in
Client-First and Server-First bumping modes. This patch always "peeks" the
SSL client hello message and apply the squid TLS parser for Client-First
and Server-First modes to.

Also this patch moves the code which retrieves SSL server details from
PeekingPeerConnector class to PeerConnector class t retrieve details  for all
SSL server side connections.

8 years agofix comment
Christos Tsantilas [Wed, 6 Apr 2016 19:31:38 +0000 (22:31 +0300)] 
fix comment

8 years agoCleanup and fixes
Christos Tsantilas [Wed, 6 Apr 2016 19:28:28 +0000 (22:28 +0300)] 
Cleanup and fixes

- remove uneeded members from classes
- Remove the TlsDetails object from ClientBio
- Enable SSL Server Hello parsing code
- remove uneeded code
- Fix bump client first and bump server first bumping modes

8 years agoFirst fast-sni implementation
Christos Tsantilas [Thu, 31 Mar 2016 18:37:15 +0000 (21:37 +0300)] 
First fast-sni implementation

Squid parses incomming client SSL hello mesage, before create any openSSL
related structures and objects. After acl check at bumping step2.
Actually creating openSSL objects for client side still can be delayed
untill the server side is finishes. The only reason to create openSSL
structures imediatelly after step2 is to use openSSL to check for unsupported
comunications features and settings and fallback to spliceOnError.

Regression:
  Squid does not parses client Hello message in the case of bump-server-first
  and bump-client-first.
  The supported and requested SSL versions (i %ssl::>received_supported_version
  and %ssl::>received_hello_version formating codes ) can not be logged for
  these modes.

The code still needs cleanup.

8 years agoImprove TLS/SSL parsing code in Handshale.cc and use it inside bio.cc for client
Christos Tsantilas [Tue, 29 Mar 2016 19:17:34 +0000 (22:17 +0300)] 
Improve TLS/SSL parsing code in Handshale.cc and use it inside bio.cc for client
and server messages

  - full implementation for TLS and SSLv2 parsers inside Handshake.cc/h files
  - remove parsing code from bio.cc
  - Store parsed info in new Security::TlsDetails struct and remove the
    Ssl::sslFeatures class
  - improve SSLv2 parsing code.

8 years agoFirst implementation for parsing SSLv2/v3 handshake messages and extracing SSL features
Christos Tsantilas [Sun, 27 Mar 2016 17:36:18 +0000 (20:36 +0300)] 
First implementation for parsing SSLv2/v3 handshake messages and extracing SSL features

8 years agorequired fixes to PeerConnector to work with Ssl::ServerBio fixes
Christos Tsantilas [Sat, 19 Mar 2016 19:31:06 +0000 (21:31 +0200)] 
required fixes to PeerConnector to work with Ssl::ServerBio fixes

8 years agomerge new SSL messages parser from lp:fetch-cert branch
Christos Tsantilas [Sat, 19 Mar 2016 19:21:44 +0000 (21:21 +0200)] 
merge new SSL messages parser from lp:fetch-cert branch

8 years agoBug 4423: adding stdio: prefix to cache_log directive produces FATAL error
Amos Jeffries [Fri, 18 Mar 2016 12:05:14 +0000 (01:05 +1300)] 
Bug 4423: adding stdio: prefix to cache_log directive produces FATAL error

8 years agoBug 4459: move ssl_db into /var/cache/squid/
Marcos Mello [Fri, 18 Mar 2016 09:38:10 +0000 (22:38 +1300)] 
Bug 4459: move ssl_db into /var/cache/squid/

* auto-generates the man(8) page for this helper.

* moves the shared Makefile variables to Common.am

* updates the heper documentation to use the builds actual
  installed paths instead of hard-coding standard paths

8 years agoBug 4459: FHS compliance: move netdb.state to /var/cache/squid
Amos Jeffries [Fri, 18 Mar 2016 07:36:45 +0000 (20:36 +1300)] 
Bug 4459: FHS compliance: move netdb.state to /var/cache/squid

8 years agoCleanup: de-duplicate HttpRequest CreateFromUrl functions
Amos Jeffries [Thu, 17 Mar 2016 03:28:14 +0000 (16:28 +1300)] 
Cleanup: de-duplicate HttpRequest CreateFromUrl functions

8 years agoSourceFormat Enforcement
Source Maintenance [Tue, 15 Mar 2016 18:12:09 +0000 (18:12 +0000)] 
SourceFormat Enforcement

8 years agoassertion failed: Write.cc:41: "!ccb->active()"
Christos Tsantilas [Tue, 15 Mar 2016 12:43:09 +0000 (14:43 +0200)] 
assertion failed: Write.cc:41: "!ccb->active()"

Bug description:
   - The client side and server side are finished
   - On server side the Ftp::Relay::finalizeDataDownload() is called and
     schedules the Ftp::Server::originDataCompletionCheckpoint
   - On client side the "Ftp::Server::userDataCompletionCheckpoint" is
     called. This is schedules a write to control connection and closes
     data connection.
   - The Ftp::Server::originDataCompletionCheckpoint is called which is
     trying to write to control connection and the assertion triggered.

This bug is an corner case, where the client-side  (FTP::Server) should
wait for the server side (Ftp::Client/Ftp::Relay) to finish its job before
respond to the FTP client. In this bug the existing mechanism, designed
to handle such problems, did not worked correctly and resulted to a double
write response to the client.

This patch try to fix the existing mechanism as follows:

- When Ftp::Server receives a "startWaitingForOrigin" callback, postpones
  writting possible responses to the client and keeps waiting for the
  stopWaitingForOrigin callback

- When the Ftp::Server receives a "stopWaitingForOrigin" callback,
  resumes any postponed response.

- When the Ftp::Client starts working on a DATA-related transaction, calls the
  Ftp::Server::startWaitingForOrigin callback

- When the Ftp::Client finishes its job or when its abort abnormaly, checks
  whether it needs to call Ftp::Server::stopWaitingForOrigin callback.

- Also this patch try to fix the status code returned to the FTP client
  taking in account the status code returned by FTP server. The
  "Ftp::Server::stopWaitingForOrigin" is used to pass the returned status code
  to the client side.

This is a Measurement Factory project

8 years agoBug 4458: Squid 4 behaviour change with external ACL arguments
Amos Jeffries [Tue, 15 Mar 2016 06:22:49 +0000 (19:22 +1300)] 
Bug 4458: Squid 4 behaviour change with external ACL arguments

8 years agoDetect when a child method declaration hides parent's virtual method.
Alex Rousskov [Sun, 13 Mar 2016 04:47:19 +0000 (21:47 -0700)] 
Detect when a child method declaration hides parent's virtual method.

Adding -Woverloaded-virtual exposed one problem in the existing code.

8 years agoAuthor: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Eduard Bagdasaryan [Sat, 12 Mar 2016 20:27:35 +0000 (13:27 -0700)] 
Author: Eduard Bagdasaryan <eduard.bagdasaryan@measurement-factory.com>
Added ACL-driven server_pconn_for_nonretriable squid.conf directive.

This directive provides fine-grained control over persistent connection
reuse when forwarding HTTP requests that Squid cannot retry. It is
useful in environments where opening new connections is very expensive
and race conditions associated with persistent connections are very rare
and/or only cause minor problems.

8 years agoTrying to avoid "looser throw specifier" error with Wheezy GCC.
Alex Rousskov [Sat, 12 Mar 2016 18:40:29 +0000 (11:40 -0700)] 
Trying to avoid "looser throw specifier" error with Wheezy GCC.

AFAICT, the default CbdataParent destructor gets implicit
"noexcept(true)" specifier (because the default destructor does not
throw itself, and CbdataParent has no data members or parents that could
have contributed potentially throwing destructors). The AsyncJob child
uses a lot of things that might throw during destruction (the compiler
cannot tell for sure because we do not use noexcept specifiers). Thus,
the compiler has to use "noexcept(false)" specifier for ~AsyncJob, which
is "looser" that "noexcept(true)" for ~CbdataParent and, hence, violates
the parent interface AsyncJob is implementing/overriding.

I have doubts about the above analysis because many other compilers,
including GCC v5 and clang are happy with the default virtual
CbdataParent destructor. If my analysis is correct, then the rule of
thumb is: Base classes must not use "= default" destructors until all
our implicit destructors become "noexcept".

8 years agoImprove class declaration consistency a bit. No functionality changes.
Alex Rousskov [Sat, 12 Mar 2016 06:16:09 +0000 (23:16 -0700)] 
Improve class declaration consistency a bit. No functionality changes.

8 years agoUse CBDATA_CHILD() instead of CBDATA_CLASS() to mark overridden methods.
Alex Rousskov [Sat, 12 Mar 2016 06:04:03 +0000 (23:04 -0700)] 
Use CBDATA_CHILD() instead of CBDATA_CLASS() to mark overridden methods.

TODO: If this works across the build farm, convert other AsyncJob kids.

8 years agoFixed clang -Winconsistent-missing-override warning.
Alex Rousskov [Sat, 12 Mar 2016 05:01:46 +0000 (22:01 -0700)] 
Fixed clang -Winconsistent-missing-override warning.

AsyncJob classes can now use C++11 overrides as long as they use the new
CBDATA_CHILD() macro instead of old CBDATA_CLASS().

I have prohibited multiple CBDATA_CHILD() classes on the same
inheritance branch by adding the "final" specifier to toCbdata(). Such
classes feel dangerous because they may have different sizes and it is
not obvious to me whether the cbdata code will call the right size-
specific delete for them. We can easily relax this later if needed.

8 years agoBug 7: Update cached entries on 304 responses.
Alex Rousskov [Fri, 11 Mar 2016 18:00:51 +0000 (11:00 -0700)] 
Bug 7: Update cached entries on 304 responses.

New Store API to update entry metadata and headers on 304s.
Support entry updates in shared memory cache and rock cache_dirs.
No changes to ufs-based cache_dirs: Their entries are still not updated.

* Atomic StoreEntry metadata updating

   StoreEntry metadata (swap_file_sz, timestamps, etc.) is used
   throughout Squid code. Metadata cannot be updated atomically because
   it has many fields, but a partial update to those fields causes
   assertions. Still, we must update metadata when updating HTTP
   headers. Locking the entire entry for a rewrite does not work well
   because concurrent requests will attempt to download a new entry
   copy, defeating the very HTTP 304 optimization we want to support.

   Ipc::StoreMap index now uses an extra level of indirection (the
   StoreMap::fileNos index) which allows StoreMap control which
   anchor/fileno is associated with a given StoreEntry key. The entry
   updating code creates a disassociated (i.e., entry/key-less) anchor,
   writes new metadata and headers using that new anchor, and then
   _atomically_ switches the map to use that new anchor. This allows old
   readers to continue reading using the stale anchor/fileno as if
   nothing happened while a new reader gets the new anchor/fileno.

   Shared memory usage increase: 8 additional bytes per cache entry: 4
   for the extra level of indirection (StoreMapFileNos) plus 4 for
   splicing fresh chain prefix with the stale chain suffix
   (StoreMapAnchor::splicingPoint). However, if the updated headers are
   larger than the stale ones, Squid will allocate shared memory pages
   to accommodate for the increase, leading to shared memory
   fragmentation/waste for small increases.

* Revamped rock index rebuild process

   The index rebuild process had to be completely revamped because
   splicing fresh and stale entry slot chain segments implies tolerating
   multiple entry versions in a single chain and the old code was based
   on the assumption that different slot versions are incompatible. We
   were also uncomfortable with the old cavalier approach to accessing
   two differently indexed layers of information (entry vs. slot) using
   the same set of class fields, making it trivial to accidentally
   access entry data while using slot index.

   During the rewrite of the index rebuilding code, we also discovered a
   way to significantly reduce RAM usage for the index build map (a
   temporary object that is allocated in the beginning and freed at the
   end of the index build process). The savings depend on the cache
   size: A small cache saves about 30% (17 vs 24 bytes per entry/slot)
   while a 1TB cache_dir with 32KB slots (which implies uneven
   entry/slot indexes) saves more than 50% (~370MB vs. ~800MB).

   Adjusted how invalid slots are counted. The code was sometimes
   counting invalid entries and sometimes invalid entry slots. We should
   always count _slots_ now because progress is measured in the number
   of slots scanned, not entries loaded. This accounting change may
   surprise users with much higher "Invalid entries" count in cache.log
   upon startup, but at least the new reports are meaningful.

   This rewrite does not attempt to solve all rock index build problems.
   For example, the code still assumes that StoreEntry metadata fits a
   single slot which is not always true for very small slots.

8 years agoDocumented some of the Packable API problems.
Alex Rousskov [Fri, 11 Mar 2016 17:53:26 +0000 (10:53 -0700)] 
Documented some of the Packable API problems.

8 years agoDo not prohibit updating Last-Modified on 304 responses.
Alex Rousskov [Fri, 11 Mar 2016 17:52:03 +0000 (10:52 -0700)] 
Do not prohibit updating Last-Modified on 304 responses.

RFC 7232 Section 4.1 says sending Last-Modified in 304 might be useful
and RFC 7234 Section 4.3.3 requires updating all non-Warning headers.

8 years agoAdded missing const qualifiers to HTTP message packing methods.
Alex Rousskov [Fri, 11 Mar 2016 17:48:57 +0000 (10:48 -0700)] 
Added missing const qualifiers to HTTP message packing methods.

8 years agoRemoved SWAPOUT_WRITING assertion from storeSwapMetaBuild().
Alex Rousskov [Fri, 11 Mar 2016 17:24:13 +0000 (10:24 -0700)] 
Removed SWAPOUT_WRITING assertion from storeSwapMetaBuild().

I do not see any strong dependency of that code on that state and we
need to be able to build swap metadata when updating a stale entry
(which would not normally be in the SWAPOUT_WRITING state).

The biggest danger is that somebody calls storeSwapMetaBuild() when the
entry metadata is not yet stable. I am not sure we have a way of
detecting that without using something as overly strong as
SWAPOUT_WRITING.

8 years agoFix memory leak of lastAclData
Nathan Hoad [Fri, 11 Mar 2016 15:03:20 +0000 (04:03 +1300)] 
Fix memory leak of lastAclData

8 years agoCleanup: improved EUI debugging
Amos Jeffries [Thu, 10 Mar 2016 14:46:28 +0000 (03:46 +1300)] 
Cleanup: improved EUI debugging

8 years agoFix memory leak of HttpRequest objects
Nathan Hoad [Thu, 10 Mar 2016 06:55:17 +0000 (19:55 +1300)] 
Fix memory leak of HttpRequest objects

8 years agoCleanup: remove last goto in libsslsquid
Amos Jeffries [Mon, 7 Mar 2016 16:03:45 +0000 (05:03 +1300)] 
Cleanup: remove last goto in libsslsquid

8 years agoSquid crashes on shutdown while cleaning up idle ICAP connections.
Christos Tsantilas [Thu, 3 Mar 2016 00:49:45 +0000 (13:49 +1300)] 
Squid crashes on shutdown while cleaning up idle ICAP connections.

The global Adaptation::Icap::TheConfig object is automatically
destroyed when Squid exits. Its destructor destroys Icap::ServiceRep
objects that, in turn, close all open connections in the idle
connections pool. Since this happens after comm_exit has destroyed all
Comm structures associated with those connections, Squid crases.

This is a Measurement Factory project.

8 years agoImplement sbuf/forward.h and use it
Francesco Chemolli [Wed, 2 Mar 2016 09:47:11 +0000 (10:47 +0100)] 
Implement sbuf/forward.h and use it

8 years agoMake use of sbuf/forward.h
Francesco Chemolli [Tue, 1 Mar 2016 16:19:49 +0000 (17:19 +0100)] 
Make use of sbuf/forward.h

8 years agoSort sbuf/Makefile.am
Francesco Chemolli [Tue, 1 Mar 2016 15:52:09 +0000 (16:52 +0100)] 
Sort sbuf/Makefile.am

8 years agoadd sbuf/forward.h
Francesco Chemolli [Tue, 1 Mar 2016 15:51:56 +0000 (16:51 +0100)] 
add sbuf/forward.h

8 years agoRename files in sbuf/ to better adhere to standards
Francesco Chemolli [Tue, 1 Mar 2016 10:37:15 +0000 (11:37 +0100)] 
Rename files in sbuf/ to better adhere  to standards

8 years agoMerged from trunk
Francesco Chemolli [Tue, 1 Mar 2016 10:35:55 +0000 (11:35 +0100)] 
Merged from trunk

8 years agoSource maintenance
Francesco Chemolli [Tue, 1 Mar 2016 10:25:13 +0000 (11:25 +0100)] 
Source maintenance

8 years agoRename sbuf/SBufList and sbuf/SBufStream
Francesco Chemolli [Tue, 1 Mar 2016 09:58:44 +0000 (10:58 +0100)] 
Rename sbuf/SBufList and sbuf/SBufStream

8 years agoRFC 7725: Add registry entry for 451 status text
Amos Jeffries [Tue, 1 Mar 2016 02:57:50 +0000 (15:57 +1300)] 
RFC 7725: Add registry entry for 451 status text

While Squid does not generate these messages automatically we still have
to relay the status line text accurately, and admin may want to use it
for deny_info status.

8 years agoBug 4447:FwdState.cc:447 "serverConnection() == conn" assertion, part2
Christos Tsantilas [Mon, 29 Feb 2016 20:00:34 +0000 (22:00 +0200)] 
Bug 4447:FwdState.cc:447 "serverConnection() == conn" assertion, part2

Fix to allow make check  work again.

8 years agoBug 4447:FwdState.cc:447 "serverConnection() == conn" assertion
Christos Tsantilas [Mon, 29 Feb 2016 18:43:03 +0000 (20:43 +0200)] 
Bug 4447:FwdState.cc:447 "serverConnection() == conn" assertion

After certain failures, FwdState::retryOrBail() may be called twice,
once from FwdState::unregisterdServerEnd() [called from
HttpStateData::swanSong()] and once from the FwdState's own connection
close handler. This may result in two concurrent connections to the
remote server, followed by an assertion upon a connection closure.

This patch:

 - After HttpStateData failures, instead of closing the squid-to-peer
   connection directly (and, hence, triggering closure handlers), calls
   HttpStateData::closeServer() and mustStop() for a cleaner exit with
   fewer wasteful side effects and better debugging.

 - Creates and remembers a FwdState close handler AsyncCall so that
   comm_remove_close_handler() can cancel an already scheduled callback.
   The conversion to the AsyncCall was necessary because legacy [close
   handler callbacks] cannot be canceled once scheduled.

This is a Measurement Factory project.

8 years agoMerged from trunk
Francesco Chemolli [Mon, 29 Feb 2016 10:33:39 +0000 (11:33 +0100)] 
Merged from trunk

8 years agoRename some files in sbuf/ and apply include paths consistently
Francesco Chemolli [Mon, 29 Feb 2016 10:11:37 +0000 (11:11 +0100)] 
Rename some files in sbuf/ and apply include paths consistently

8 years agoSourceFormat Enforcement
Source Maintenance [Sun, 28 Feb 2016 12:12:11 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoDocs: release notes update
Marcos Mello [Sun, 28 Feb 2016 11:03:39 +0000 (00:03 +1300)] 
Docs: release notes update

8 years agoCleanup: separate SBufStats from SBuf.h
Amos Jeffries [Sun, 28 Feb 2016 07:49:02 +0000 (20:49 +1300)] 
Cleanup: separate SBufStats from SBuf.h

8 years agoRemove most *_DEPENDENCIES clauses from src/Makefile.am, they are not necessary
Francesco Chemolli [Sat, 27 Feb 2016 09:26:00 +0000 (10:26 +0100)] 
Remove most *_DEPENDENCIES clauses from src/Makefile.am, they are not necessary

8 years agorename SBufStringConvert.h to StringConvert.h
Francesco Chemolli [Fri, 26 Feb 2016 16:45:24 +0000 (17:45 +0100)] 
rename SBufStringConvert.h to StringConvert.h

8 years agorenamed SBufExceptions to sbuf/Exceptions
Francesco Chemolli [Fri, 26 Feb 2016 16:36:24 +0000 (17:36 +0100)] 
renamed SBufExceptions to sbuf/Exceptions

8 years agorenamed SBufDetailedStats.h to sbuf/DetailedStats.h
Francesco Chemolli [Fri, 26 Feb 2016 15:53:52 +0000 (16:53 +0100)] 
renamed SBufDetailedStats.h to sbuf/DetailedStats.h

8 years agorenamed sbuf/SBufAlgos.h to sbuf/Algorithms.h
Francesco Chemolli [Fri, 26 Feb 2016 15:44:19 +0000 (16:44 +0100)] 
renamed sbuf/SBufAlgos.h to sbuf/Algorithms.h

8 years agoMerged from trunk
Francesco Chemolli [Fri, 26 Feb 2016 15:18:52 +0000 (16:18 +0100)] 
Merged from trunk

8 years agoSourceFormat Enforcement
Source Maintenance [Fri, 26 Feb 2016 00:11:57 +0000 (00:11 +0000)] 
SourceFormat Enforcement

8 years agoRefactor SBuf into own library and simplify link time dependencies
Francesco Chemolli [Thu, 25 Feb 2016 21:30:10 +0000 (22:30 +0100)] 
Refactor SBuf into own library and simplify link time dependencies

8 years agoImplement audit suggestions
Francesco Chemolli [Thu, 25 Feb 2016 18:01:29 +0000 (19:01 +0100)] 
Implement audit suggestions

8 years agoMerged from trunk
Francesco Chemolli [Thu, 25 Feb 2016 16:49:08 +0000 (17:49 +0100)] 
Merged from trunk

8 years agoavoid unnecessary SBuf copies
Francesco Chemolli [Thu, 25 Feb 2016 16:44:46 +0000 (17:44 +0100)] 
avoid unnecessary SBuf copies

8 years agoFix include paths in some unit tests
Francesco Chemolli [Thu, 25 Feb 2016 16:43:51 +0000 (17:43 +0100)] 
Fix include paths in some unit tests

8 years agoavoid unnecessary SBuf copies
Francesco Chemolli [Thu, 25 Feb 2016 16:43:21 +0000 (17:43 +0100)] 
avoid unnecessary SBuf copies

8 years agoImprove documentation
Francesco Chemolli [Thu, 25 Feb 2016 16:34:29 +0000 (17:34 +0100)] 
Improve documentation

8 years agoShuffle libbase in its proper order, fix formatting, remove some unneeded files
Francesco Chemolli [Thu, 25 Feb 2016 16:11:03 +0000 (17:11 +0100)] 
Shuffle libbase in its proper order, fix formatting, remove some unneeded files

8 years agoRemoved spurious file in libsbuf SOURCES
Francesco Chemolli [Thu, 25 Feb 2016 15:57:10 +0000 (16:57 +0100)] 
Removed spurious file in libsbuf SOURCES

8 years agoRemove some _DEPENDENCIES declarations for unit tests
Francesco Chemolli [Thu, 25 Feb 2016 15:50:26 +0000 (16:50 +0100)] 
Remove some _DEPENDENCIES declarations for unit tests

8 years agoRemoved unnecessary stubs from unit tests
Francesco Chemolli [Thu, 25 Feb 2016 14:59:21 +0000 (15:59 +0100)] 
Removed unnecessary stubs from unit tests

8 years agoRemoved unnecessary stubs from unit tests
Francesco Chemolli [Thu, 25 Feb 2016 13:18:24 +0000 (14:18 +0100)] 
Removed unnecessary stubs from unit tests

8 years agoBug 4450: wait() related cleanup
Marcos Mello [Thu, 25 Feb 2016 01:52:52 +0000 (14:52 +1300)] 
Bug 4450: wait() related cleanup

8 years agoDocs: release notes about process manager changes
Amos Jeffries [Thu, 25 Feb 2016 00:16:34 +0000 (13:16 +1300)] 
Docs: release notes about process manager changes

8 years agoBug 3826: Add --foreground option to fix -z process behaviour
Marcos Mello [Wed, 24 Feb 2016 23:55:48 +0000 (12:55 +1300)] 
Bug 3826: Add --foreground option to fix -z process behaviour

8 years agoMove SBuf<->String conversion to own header.
Francesco Chemolli [Wed, 24 Feb 2016 18:12:43 +0000 (19:12 +0100)] 
Move SBuf<->String conversion to own header.

8 years agoRemove SBUF_SOURCE from src/Makefile.am
Francesco Chemolli [Wed, 24 Feb 2016 12:35:14 +0000 (13:35 +0100)] 
Remove SBUF_SOURCE from src/Makefile.am

8 years agoMove SBufDetailedStats to src/sbuf
Francesco Chemolli [Wed, 24 Feb 2016 12:16:16 +0000 (13:16 +0100)] 
Move SBufDetailedStats to src/sbuf

8 years agoBug 3826: SMP compatibility with systemd
Marcos Mello [Tue, 23 Feb 2016 22:27:43 +0000 (11:27 +1300)] 
Bug 3826: SMP compatibility with systemd

** These changes require capabilities changes specific to Squid-4 and
   require systemd 209+

NOTE: 'squid -z' command does not yet support SMP with systemd.

Differences from the Squid-3 tools/systemd/squid.service:

- After=nss-lookup.target, for people running a local DNS server like BIND.
  Since there is no requirement dependency, it is a NOP when no such
  service is running.

- Type=forking and squid without -N in ExecStart: SMP now works.

- PIDFile=/var/run/squid.pid to tell systemd what pid is the main one. This
  is actually optional with Squid 4, because systemd will consider its first
  child as the main pid. But let's be safe. DEFAULT_PID_FILE could be used
  here with proper autoconf/automake magic...

- ExecReload calls kill rather than 'squid -k reconfigure'. systemd already
  knows the main pid.

- KillMode=mixed. The old KillMode=process sends SIGTERM (and SIGKILL after
  TimeoutStopSec) only to main daemon process. 'mixed' OTOH sends SIGTERM
  only to main process, but SIGKILL to all services' cgroup processes after
  timeout. With 'mixed' systemd ensures if daemon shutdown fails it will
  clean up all the remains. 'mixed' requires systemd >= 209.

8 years ago4.0.7 SQUID_4_0_7
Amos Jeffries [Tue, 23 Feb 2016 17:40:44 +0000 (06:40 +1300)] 
4.0.7