]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
8 years agoBug 4563: duplicate code in httpMakeVaryMark
Amos Jeffries [Mon, 15 Aug 2016 11:26:37 +0000 (23:26 +1200)] 
Bug 4563: duplicate code in httpMakeVaryMark

8 years agoFix SSL-Bump failure results in SEGFAULT
Amos Jeffries [Mon, 15 Aug 2016 11:14:29 +0000 (23:14 +1200)] 
Fix SSL-Bump failure results in SEGFAULT

8 years agoFixed build on systems needing explicit <utility> in RegexPattern.cc.
Alex Rousskov [Sun, 14 Aug 2016 01:17:57 +0000 (19:17 -0600)] 
Fixed build on systems needing explicit <utility> in RegexPattern.cc.

... after r14795.

Also removed bogus comments implying that std::move() does something to
its argument. That function is just a type cast; it does nothing else!
We use std::move() so that the compiler picks a move constructor or
assignment (where available). In case of RegexPattern::flags, using
std::move() has no effect because integers do not have those move
methods. However, it may be a good idea to use std::move() anyway
because the type of RegexPattern::flags might change in the future and
for consistency sake. Thus, I did not remove std::move(), only comments.

8 years agoSourceFormat Enforcement
Source Maintenance [Sat, 13 Aug 2016 12:12:14 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoBug 4561: Replace use of default move operators with explicit implementation
Amos Jeffries [Sat, 13 Aug 2016 10:12:06 +0000 (22:12 +1200)] 
Bug 4561: Replace use of default move operators with explicit implementation

The '= default' syntax for move assignment operator and constructor can
result in double-free crashes when the class type containspointer members
since the trivial move uses std::memmove() which does not perform the
required zeroing/nullptr of the temporary source object being moved.

8 years agoMake Squid death due to overloaded helpers optional.
Eduard Bagdasaryan [Sat, 13 Aug 2016 00:43:50 +0000 (12:43 +1200)] 
Make Squid death due to overloaded helpers optional.

Added on-persistent-overload=action option to helpers. Helper overload
is defined as running with an overflowing queue. Persistent helper
overload is [still] defined as being overloaded for more than 3 minutes.

The default behavior is unchanged(*) -- Squid worker dies with a fatal
error at the attempt to submit a new request to a persistenly overloaded
helper. This default behavior can also be configured explicitly using
on-persistent-overload=die.

With on-persistent-overload=ERR, when dealing with a persistently
overloaded helper, Squid immediately skips the helper request and sends
an ERR response to the caller. Squid informs the admin when it starts
and when it stops skipping helper requests due to persistent overload.

The code had conflicting notions of an "overloaded helper". The external
ACL helper, the URL rewriter, and the store ID code used queueFull() to
test whether the new request would overflow the queue (and, hence,
overload the helper), but queueFull() itself did not check whether the
queue was full! It checked whether the queue was already overflowing.
This confusion resulted in that code scheduling one extra helper request
before enabling bypass. The code and its documentation are now more
consistent (and better match the "overload" terminology used by the new
configuration option, which also feels better than calling the helper
"full").

(*) Resolving the above confusion resulted in minor (one request)
differences in the number of helper requests queued by Squid for
external ACL, URL rewriting, and store ID helpers, with the adjusted
behavior [better] matching the documentation.

8 years agoBug 4561: revert r14783
Amos Jeffries [Fri, 12 Aug 2016 17:16:38 +0000 (05:16 +1200)] 
Bug 4561: revert r14783

8 years agoCleanup cleanup: parseNamedIntList needs #if protections since r14789.
Alex Rousskov [Thu, 11 Aug 2016 20:49:22 +0000 (14:49 -0600)] 
Cleanup cleanup: parseNamedIntList needs #if protections since r14789.

There are design problems with r14789, but I am only addressing the
build failure.

8 years agoSourceFormat Enforcement
Source Maintenance [Wed, 10 Aug 2016 06:12:03 +0000 (06:12 +0000)] 
SourceFormat Enforcement

8 years agoCleanup: refactor FwdState pinned connection handling slightly
Amos Jeffries [Wed, 10 Aug 2016 00:56:30 +0000 (12:56 +1200)] 
Cleanup: refactor FwdState pinned connection handling slightly

Don't try to be too smart with indirect serverConn == NULL details. It
just confuses static analysis.

This code ordering should resolve the false positive Coverity Scan
issue 740373 and let any real problem show through.

8 years agoCleanup: make static analyzers happier with legacy config parsing
Amos Jeffries [Wed, 10 Aug 2016 00:45:22 +0000 (12:45 +1200)] 
Cleanup: make static analyzers happier with legacy config parsing

Use return statements after self_destruct() helps Coverity Scan see that
there is no NULL-dereference going on and lowers is false-positive rate.

8 years agoCleanup: remove some minor memory leaks in external ACL config parsing
Amos Jeffries [Wed, 10 Aug 2016 00:01:26 +0000 (12:01 +1200)] 
Cleanup: remove some minor memory leaks in external ACL config parsing

 Detected by Coveruty Scan. Issue 434089

8 years agoFix typo in rev.14786
Amos Jeffries [Tue, 9 Aug 2016 22:40:09 +0000 (10:40 +1200)] 
Fix typo in rev.14786

8 years agoBug 4428: mal-formed Cache-Control:stale-if-error header
Amos Jeffries [Tue, 9 Aug 2016 22:03:59 +0000 (10:03 +1200)] 
Bug 4428: mal-formed Cache-Control:stale-if-error header

8 years agoFix logic error in rev.14321
Amos Jeffries [Tue, 9 Aug 2016 14:08:25 +0000 (02:08 +1200)] 
Fix logic error in rev.14321

 Using !=0 on both string compares means any login= value will permit
 40x responses through. Only PASS and PASSTHRU should be doing that.

 Detected by Coverity Scan. Issue 1364711

8 years agoCleanup: fix several minor memory leaks in config parsing
Amos Jeffries [Tue, 9 Aug 2016 13:29:44 +0000 (01:29 +1200)] 
Cleanup: fix several minor memory leaks in config parsing

Most of these are only short-term leaks that occur when aborting due to
bad configuration. But getting rid of them will reduce noise in analysis.

 Detected by Coverity Scan. Issue 1364740136474113647431364745.

8 years agoCleanup: add move semantics to CbcPointer template
Amos Jeffries [Tue, 9 Aug 2016 13:27:06 +0000 (01:27 +1200)] 
Cleanup: add move semantics to CbcPointer template

 Detected by Coverity Scan. Issue 1364735

8 years agoCleanup: fix minor memory leak in squid.conf parsing
Amos Jeffries [Mon, 8 Aug 2016 23:34:31 +0000 (11:34 +1200)] 
Cleanup: fix minor memory leak in squid.conf parsing

 Detected by Coverity Scan. Issue 1154224

8 years agoCleanup: remove unused Ipc::MemMap::ttl
Amos Jeffries [Mon, 8 Aug 2016 23:20:36 +0000 (11:20 +1200)] 
Cleanup: remove unused Ipc::MemMap::ttl

 Detected by Coverity Scan. Issue 1364747

8 years agoCleanup: make static analysis a bit happier
Amos Jeffries [Mon, 8 Aug 2016 17:51:44 +0000 (05:51 +1200)] 
Cleanup: make static analysis a bit happier

Use return after self_destruct() to make code path analysis a bit better.

 Detected by Coverity Scan. Issue 1154203

8 years agoFix eCAP build error after rev.14778
Eduard Bagdasaryan [Mon, 8 Aug 2016 10:40:57 +0000 (22:40 +1200)] 
Fix eCAP build error after rev.14778

8 years agoCleanup: make static analyzers happier
Amos Jeffries [Sat, 6 Aug 2016 06:06:27 +0000 (18:06 +1200)] 
Cleanup: make static analyzers happier

Coverity and other static analyers are not smart enough to detect that
self_destruct() does not return.SO get confused about NULL derefernces.

 Coverity Scan. Issues 1364730136472713647241364729, 434088.

8 years agoCleanup: check URN list before using it
Amos Jeffries [Sat, 6 Aug 2016 05:55:37 +0000 (17:55 +1200)] 
Cleanup: check URN list before using it

The check should not be needed, the URN parse function always allocates.
But do it at the right time even so.

 Detected by Coverity Scan. Issue 434062

8 years agoFix clang errors with global InstanceId initialization
Amos Jeffries [Sat, 6 Aug 2016 04:49:55 +0000 (16:49 +1200)] 
Fix clang errors with global InstanceId initialization

Move static member Last into change() method to avoid initialization order
errors when a caller uses a global InstanceId object before the library
instantiating its template is initialized.

Also, convert the Prefix static member to a constant string in a prefix()
method to avoid the same issue there.

8 years agoCleanup: remove some minor memory leaks on config parser self_destruct
Amos Jeffries [Fri, 5 Aug 2016 22:00:51 +0000 (10:00 +1200)] 
Cleanup: remove some minor memory leaks on config parser self_destruct

 Identified by Coverity Scan. ID 13647421364744.

8 years ago4.0.13 SQUID_4_0_13
Amos Jeffries [Fri, 5 Aug 2016 12:51:46 +0000 (00:51 +1200)] 
4.0.13

8 years agoBug 4551: fix exceptions in new chunked decoder
Amos Jeffries [Tue, 2 Aug 2016 15:06:37 +0000 (03:06 +1200)] 
Bug 4551: fix exceptions in new chunked decoder

... fixing incremental CRLF parsing in both chunked encoding and
status-line parsing contexts.

8 years agoTry fix "'fatal' was not declared in this scope" compile error after r14769
Christos Tsantilas [Mon, 1 Aug 2016 13:57:14 +0000 (16:57 +0300)] 
Try fix "'fatal' was not declared in this scope" compile error after r14769

8 years agoSourceFormat Enforcement
Source Maintenance [Mon, 1 Aug 2016 12:12:15 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoBug 4555: Minor improvements to error pages CSS
Marcos Mello [Mon, 1 Aug 2016 11:40:09 +0000 (23:40 +1200)] 
Bug 4555: Minor improvements to error pages CSS

8 years agoFetch missing certificates
Christos Tsantilas [Mon, 1 Aug 2016 11:27:44 +0000 (14:27 +0300)] 
Fetch missing certificates

Many web servers do not have complete certificate chains. Many browsers use
certificate extensions of the server certificate and download the missing
intermediate certificates automatically from the Internet.
This patch add this feature to Squid.

The information for missing issuer certificates provided by the Authority
Information Access X509 extension. This describes the format and the location
of additional information provided by the issuer of the certificate.

This patch:
  - Implements a class Downloader as an independet AsyncJob class. This new
    class can be used by internal squid subsystems to download objects from
    the network.
  - Modify Ssl::PeerConnector class to use new Downloader class to
    retrieve missing certificates from the net. The URIs of missing
    certificates from the Authority Information Access X509 extension.
  - Implements a new basic certificates parser based on openSSL for the
    TLS handshake messages parser.
  - Modify the Ssl::ServerBio class to:
     * Buffer the Server Hello message and not pass it to the openSSL library
       until downloading missing certificates, if any, is finished.
     * Extract server certificates from server hello message.
       This is required to check if there are missing certificates, and if yes
       give the chance to squid to download missing certificates and complete
       certificate chains before pass them for processing to openSSL

TODO:
  - Add support for certs-only CMS message.
    From  RFC 4325:
    "Where the information is available via HTTP or FTP, accessLocation
    MUST be a uniformResourceIdentifier and the URI MUST point to either
    a single DER encoded certificate as specified in [RFC2585] or a
    collection of certificates in a BER or DER encoded "certs-only" CMS
    message as specified in [RFC2797]. "
    ...
    "Conforming applications that support HTTP or FTP for accessing
    certificates MUST be able to accept individual DER encoded
    certificates and SHOULD be able to accept "certs-only" CMS messages."

This is a Measurement Factory project

8 years agomerge from trunk-r14768
Christos Tsantilas [Mon, 1 Aug 2016 11:11:47 +0000 (14:11 +0300)] 
merge from trunk-r14768

8 years agoPolishing fixes from squid-dev review
Christos Tsantilas [Mon, 1 Aug 2016 09:42:45 +0000 (12:42 +0300)] 
Polishing fixes from squid-dev review

8 years agoFix crash after rev.14735
Alex Rousskov [Sat, 30 Jul 2016 19:55:15 +0000 (07:55 +1200)] 
Fix crash after rev.14735

8 years agoFix Certificate Validator buffer-overflow crashes Squid (commit r14757)
Christos Tsantilas [Fri, 29 Jul 2016 08:31:12 +0000 (11:31 +0300)] 
Fix Certificate Validator buffer-overflow crashes Squid (commit r14757)

- In the case of unexpected or timedout helper replies we must ignore the
  current message untill an eom found.

- Inside helperStatefulHandleRead, the current Helper::Xaction can be NULL
  in the case of unexpected helper reply.

This is a Measurement Factory Project

8 years agoCleanup: remove useless dead #include lines
Amos Jeffries [Wed, 27 Jul 2016 21:20:40 +0000 (09:20 +1200)] 
Cleanup: remove useless dead #include lines

8 years agoCleanup: sort stub_libsecurity
Amos Jeffries [Wed, 27 Jul 2016 21:16:35 +0000 (09:16 +1200)] 
Cleanup: sort stub_libsecurity

8 years agoTLS: do not hang when 'connector' fails
Amos Jeffries [Wed, 27 Jul 2016 12:24:50 +0000 (00:24 +1200)] 
TLS: do not hang when 'connector' fails

8 years agoSourceFormat Enforcement
Source Maintenance [Wed, 27 Jul 2016 12:12:14 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoCleanup: Move PeerConnector and BlindPeerConnector to libsecurity
Amos Jeffries [Wed, 27 Jul 2016 11:06:57 +0000 (23:06 +1200)] 
Cleanup: Move PeerConnector and BlindPeerConnector to libsecurity

Just namespace renaming and redux of USE_OPENSSL wrapped code sections.

8 years agoSquid segfault via Ftp::Client::readControlReply().
Christos Tsantilas [Wed, 27 Jul 2016 08:18:03 +0000 (11:18 +0300)] 
Squid segfault via Ftp::Client::readControlReply().

Ftp::Client::scheduleReadControlReply(), which may called from the
asynchronous start() or readControlReply()/handleControlReply()
handlers, does not check whether the control connection is still usable
before using it.

This is a Measurement Factory project.

8 years agoSourceFormat Enforcement
Source Maintenance [Mon, 25 Jul 2016 12:12:06 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoCertificate Validator buffer-overflow crashes Squid part2: fix 'make check' errors
Christos Tsantilas [Mon, 25 Jul 2016 11:24:12 +0000 (14:24 +0300)] 
Certificate Validator buffer-overflow crashes Squid part2: fix 'make check' errors

8 years agokerberos_ldap_group: support SSL/TLS used to connect to an LDAP server
Markus Moeller [Mon, 25 Jul 2016 10:59:47 +0000 (22:59 +1200)] 
kerberos_ldap_group: support SSL/TLS used to connect to an LDAP server

Also, apply code formatting

8 years agoCertificate Validator buffer-overflow crashes Squid
Christos Tsantilas [Mon, 25 Jul 2016 10:22:54 +0000 (13:22 +0300)] 
Certificate Validator buffer-overflow crashes Squid

Certain server certificates with a large chain and/or large certificates
(i.e. due to excessive amount of SAN entries) are producing helper requests and
replies which are larger than the 32KB limit set in src/helper.cc.

The major problem for squid is that the helper response should fit in the
helper read buffer. Currently squid starts with 4K request buffer and if
required may increase the buffer size up to 32K.

This patch:
  - Uses a constant-size read buffer for helpers and accumulates the helper
    response to Helper::Reply object.
  - Changes the HelperServerBase::requests list to hold list of the new
    Helper::Xaction class which holds pairs of Helper::Request and
    Helper::Reply objects
  - Modifies the Helper::Reply class to accumulate data and restricts the
    required memory allocations

This is a Measurement Factory project

8 years agoFix clang 'smpAware' overrides a member function but is not marked 'override'
Amos Jeffries [Sun, 24 Jul 2016 06:30:24 +0000 (18:30 +1200)] 
Fix clang 'smpAware' overrides a member function but is not marked 'override'

8 years agoCollapse internal revalidation requests (SMP-unaware caches).
Eduard Bagdasaryan [Sat, 23 Jul 2016 13:36:56 +0000 (01:36 +1200)] 
Collapse internal revalidation requests (SMP-unaware caches).

... also address Bug 4311 and partially address Bug 2833 and Bug 4471.

Extend collapsed_forwarding functionality to internal revalidation
requests. This implementation does not support Vary-controlled cache
objects and is limited to SMP-unaware caching environments, where each
Squid worker knows nothing about requests and caches handled by other
workers. However, it also lays critical groundwork for future SMP-aware
collapsed revalidation support.

Prior to these changes, multiple concurrent HTTP requests for the same
stale cached object always resulted in multiple internal revalidation
requests sent by Squid to the origin server. Those internal requests
were likely to result in multiple competing Squid cache updates, causing
cache misses and/or more internal revalidation requests, negating
collapsed forwarding savings.

Internal cache revalidation requests are collapsed if and only if
collapsed_forwarding is enabled. There is no option to control just
revalidation collapsing because there is no known use case for it.

* Public revalidation keys

Each Store entry has a unique key. Keys are used to find entries in the
Store (both already cached/swapped_out entries and not). Public keys are
normally tied to the request method and target URI. Same request
properties normally lead to the same public key, making cache hits
possible. If we were to calculate a public key for an internal
revalidation request, it would have been the same as the public key of
the stale cache entry being revalidated. Adding a revalidation response
to Store would have purged that being-revalidated cached entry, even if
the revalidation response itself was not cachable.

To avoid purging being-revalidated cached entries, the old code used
private keys for internal revalidation requests. Private keys are always
unique and cannot accidentally purge a public entry. On the other hand,
for concurrent [revalidation] requests to find the store entry to
collapse on, that store entry has to have a public key!

We resolved this conflict by adding "scope" to public keys:

* Regular/old public keys have default empty scope (that does not affect
  key generation). The code not dealing with collapsed revalidation
  continues to work as before. All entries stored in caches continue to
  have the same keys (with an empty scope).

* When collapsed forwarding is enabled, collapsable internal
  revalidation requests get public keys with a "revalidation" scope
  (that is fed to the MD5 hash when the key is generated). Such a
  revalidation request can find a matching store entry created by
  another revalidation request (and collapse on it), but cannot clash
  with the entry being revalidated (because that entry key is using a
  different [empty] scope).

This change not only enables collapsing of internal revalidation
requests within one worker, but opens the way for SMP-aware workers to
share information about collapsed revalidation requests, similar to how
those workers already share information about being-swapped-out cache
entries.

After receiving the revalidation response, each collapsed revalidation
request may call updateOnNotModified() to update the stale entry [with
the same revalidation response!]. Concurrent entry updates would have
wasted many resources, especially for disk-cached entries that support
header updates, and may have purged being-revalidated entries due to
locking conflicts among updating transactions. To minimize these
problems, we adjusted header and entry metadata updating logic to skip
the update if nothing have changed since the last update.

Also fixed Bug 4311: Collapsed forwarding deadlocks for SMP Squids using
SMP-unaware caches. Collapsed transactions stalled without getting a
response because they were waiting for the shared "transients" table
updates. The table was created by Store::Controller but then abandoned (not
updated) by SMP-unaware caches. Now, the transients table is not created
at all unless SMP-aware caches are present. This fix should also address
complaints about shared memory being used for Squid instances without
SMP-aware caches.

A combination of SMP-aware and SMP-unaware caches is still not supported
and is likely to stall collapsed transactions if they are enabled. Note
that, by default, the memory cache is SMP-aware in SMP environments.

8 years agoQuieten digest oversize warnings
Amos Jeffries [Sat, 23 Jul 2016 06:02:56 +0000 (18:02 +1200)] 
Quieten digest oversize warnings

8 years agoSourceFormat Enforcement
Source Maintenance [Sat, 23 Jul 2016 00:12:14 +0000 (00:12 +0000)] 
SourceFormat Enforcement

8 years agoFix some failed transactions not being logged.
Eduard Bagdasaryan [Fri, 22 Jul 2016 19:37:12 +0000 (07:37 +1200)] 
Fix some failed transactions not being logged.

There are situations when Squid logs nothing to access.log after an
[abnormal] transaction termination. Such "stealthy" transactions may be
a security risk and an accounting problem.

ClientHttpRequest is responsible for logging most transactions but that
object is created only after the HTTP request headers are successfully
parsed. Request header parsing errors may be detected and logged
appropriately, but the job handling the incoming transaction may
terminate for reasons outside the parsing code control (e.g., a job-
killing exception thrown when there are no request headers to start
parsing yet or when the job waits for more request headers to finishing
parsing).

This change adds access logging for three cases:

1. accept(2) system call errors (before ConnStateData job is created).

2. Unexpected ConnStateData job termination, when there is no
   ClientHttpRequest to log the failure.

3. Connections which send no bytes: these connections drain Squid
   resources and, hence, should be logged.
   TODO: make this behavior configurable because some browsers are known to
   routinely create such connections(and, hence, logging them may create
   too much noise in some environments).

8 years agoAdd stub for log/liblog symbols
Amos Jeffries [Fri, 22 Jul 2016 13:19:36 +0000 (01:19 +1200)] 
Add stub for log/liblog symbols

8 years agoAdd missing 'tls' option for cache_peer
Amos Jeffries [Fri, 22 Jul 2016 08:38:30 +0000 (20:38 +1200)] 
Add missing 'tls' option for cache_peer

8 years agoCleanup: remove XSTD_USE_LIBLTDL, which has not been needed in a long while.
Amos Jeffries [Wed, 20 Jul 2016 14:33:14 +0000 (02:33 +1200)] 
Cleanup: remove XSTD_USE_LIBLTDL, which has not been needed in a long while.

8 years agoRevert changes in rev.14726
Amos Jeffries [Mon, 18 Jul 2016 12:36:38 +0000 (00:36 +1200)] 
Revert changes in rev.14726

8 years agoCleanup: drop redundant parse buffer check
Eduard Bagdasaryan [Sun, 17 Jul 2016 09:03:05 +0000 (21:03 +1200)] 
Cleanup: drop redundant parse buffer check

8 years agoFix error: taking the absolute value of unsigned type after rev.14739
Amos Jeffries [Sat, 16 Jul 2016 11:13:00 +0000 (23:13 +1200)] 
Fix error: taking the absolute value of unsigned type after rev.14739

8 years agoSourceFormat Enforcement
Source Maintenance [Fri, 15 Jul 2016 18:12:18 +0000 (18:12 +0000)] 
SourceFormat Enforcement

8 years agomake the Downloader::CbDialer a CallDialer kid
Christos Tsantilas [Fri, 15 Jul 2016 14:06:44 +0000 (17:06 +0300)] 
make the Downloader::CbDialer a CallDialer kid

8 years agoremove XXX comments from PeerConnector related to Downloader: they are not valid...
Christos Tsantilas [Fri, 15 Jul 2016 13:28:48 +0000 (16:28 +0300)] 
remove XXX comments from PeerConnector related to Downloader: they are not valid any more

8 years agoCleanup: remove unused references to SquidList.h
Amos Jeffries [Fri, 15 Jul 2016 13:13:03 +0000 (01:13 +1200)] 
Cleanup: remove unused references to SquidList.h

8 years agocall setLogUri to set url if no adaptation is used
Christos Tsantilas [Fri, 15 Jul 2016 13:12:09 +0000 (16:12 +0300)] 
call setLogUri to set url if no adaptation is used

8 years agoCleanup: use std::queue for UFS file I/O queues
Amos Jeffries [Fri, 15 Jul 2016 13:09:18 +0000 (01:09 +1200)] 
Cleanup: use std::queue for UFS file I/O queues

8 years agoSquid-dev review comments by Alex and Amos
Christos Tsantilas [Fri, 15 Jul 2016 11:05:34 +0000 (14:05 +0300)] 
Squid-dev review comments by Alex and Amos

8 years agoCleanup: TunnelStateData switchToTunnel function
Amos Jeffries [Wed, 13 Jul 2016 12:59:17 +0000 (00:59 +1200)] 
Cleanup: TunnelStateData switchToTunnel function

8 years agoCleanup: PeerConnector session initialization method
Amos Jeffries [Wed, 13 Jul 2016 12:39:22 +0000 (00:39 +1200)] 
Cleanup: PeerConnector session initialization method

* rename initializeSsl() method to initializeTls()

* use SessionPointer instead of SessionPtr

* return value is best used in boolean expressions, so make it bool
  this also resolves some template issues with SessionPointer return type.

* rename the session parameter to serverSession which better documents what
  it is than 'ssl', and distinguishes it from clientSession in child methods
  which have to deal with both.

8 years agoFix error: 'storeDigestRegisterWithCacheManager' was not declared
Amos Jeffries [Wed, 13 Jul 2016 11:31:50 +0000 (23:31 +1200)] 
Fix error: 'storeDigestRegisterWithCacheManager' was not declared

8 years agoBug 4534: assertion failure in xcalloc when using many cache_dir
Amos Jeffries [Tue, 12 Jul 2016 16:15:51 +0000 (04:15 +1200)] 
Bug 4534: assertion failure in xcalloc when using many cache_dir

8 years agoDocumentation, polishing and fixes
Christos Tsantilas [Mon, 11 Jul 2016 15:34:28 +0000 (18:34 +0300)] 
Documentation, polishing and fixes

 - Add/fix basic documentation for Downloader and DownloaderContext classes
 - Move DownloaderContext class definition to Downloader.cc file
 - fix cbdata leaks inside DownloaderCotnext destructor, caused by simple typo
   mistake.
 - Do not cbdatalock the ClientHttpRequest object inside DownloaderContext.
   This class is responsible to hold the main pointer and finaly delete the
   ClientHttpRequest object.

8 years agoCleanup: Ssl::Create*() functions
Amos Jeffries [Mon, 11 Jul 2016 10:57:11 +0000 (22:57 +1200)] 
Cleanup: Ssl::Create*() functions

* return value is only used in boolean expressions, so make it bool

* pass Comm::ConnectionPointer instead of raw-FD value

8 years agobasic_db_auth: add support for unsalted SHA1 passwords
jltallon [Fri, 8 Jul 2016 12:30:01 +0000 (00:30 +1200)] 
basic_db_auth: add support for unsalted SHA1 passwords

8 years agoSourceFormat Enforcement
Source Maintenance [Fri, 8 Jul 2016 12:12:14 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoReplaced TidyPointer with std::unique_ptr.
Amos Jeffries [Fri, 8 Jul 2016 11:26:40 +0000 (23:26 +1200)] 
Replaced TidyPointer with std::unique_ptr.

LockingPointer is now a stand-alone class that is understood (and
documented) as a typical shared pointer with OpenSSL-friendly object
importing methods. Replaced its TidyPointer::reset() abuse with an
explicit resetWithoutLocking() method after reviewing that all such
calls needed no locking indeed.

8 years agoPolish from final audit
Amos Jeffries [Fri, 8 Jul 2016 06:24:33 +0000 (18:24 +1200)] 
Polish from final audit

8 years agoMerged from trunk rev.14734
Amos Jeffries [Thu, 7 Jul 2016 19:03:02 +0000 (07:03 +1200)] 
Merged from trunk rev.14734

8 years agoSync with trunk r14734
Christos Tsantilas [Thu, 7 Jul 2016 08:17:21 +0000 (11:17 +0300)] 
Sync with trunk r14734

8 years agoReplace LockingPointer::reset with resetWithoutLocking
Amos Jeffries [Tue, 5 Jul 2016 23:37:12 +0000 (11:37 +1200)] 
Replace LockingPointer::reset with resetWithoutLocking

This required the GnuTLS and void session pointer definitions being made
to use LockingPointer.

Also, use std::move assignment instead of X.reset(Y.release()) pattern.

8 years agoCleanup: make createStaticServerContext deal with ContextPointer
Amos Jeffries [Tue, 5 Jul 2016 17:00:36 +0000 (05:00 +1200)] 
Cleanup: make createStaticServerContext deal with ContextPointer

This method is about initializing the staticContext member of
ServerOptions. There is no need to involve the caller directly in those
logistics.

8 years agoBug 4542: authentication credentials IP TTL updated incorrectly
Anonymous [Tue, 5 Jul 2016 05:45:44 +0000 (17:45 +1200)] 
Bug 4542: authentication credentials IP TTL updated incorrectly

8 years agoUpdate LockingPointer methods and documentation
Amos Jeffries [Mon, 4 Jul 2016 15:21:08 +0000 (03:21 +1200)] 
Update LockingPointer methods and documentation

8 years agoBug 4540: revert r14720 buffer update
Amos Jeffries [Sat, 2 Jul 2016 06:47:55 +0000 (18:47 +1200)] 
Bug 4540: revert r14720 buffer update

8 years agoAdd missing dereference operator in TidyPointer
Amos Jeffries [Fri, 1 Jul 2016 17:35:00 +0000 (05:35 +1200)] 
Add missing dereference operator in TidyPointer

8 years ago4.0.12 SQUID_4_0_12
Amos Jeffries [Fri, 1 Jul 2016 13:25:33 +0000 (01:25 +1200)] 
4.0.12

8 years agoSourceFormat Enforcement
Source Maintenance [Fri, 1 Jul 2016 12:12:10 +0000 (12:12 +0000)] 
SourceFormat Enforcement

8 years agoPrep for 4.0.12 and 3.5.20
Amos Jeffries [Fri, 1 Jul 2016 11:30:00 +0000 (23:30 +1200)] 
Prep for 4.0.12 and 3.5.20

8 years agoAdd missing STUBS for rev.14726
Amos Jeffries [Fri, 1 Jul 2016 11:12:09 +0000 (23:12 +1200)] 
Add missing STUBS for rev.14726

8 years agoGnuTLS: support for TLS session resume
Amos Jeffries [Thu, 30 Jun 2016 22:10:55 +0000 (10:10 +1200)] 
GnuTLS: support for TLS session resume

8 years agoBug 4523: smblib compile fails on NetBSD
Ian Clark [Thu, 30 Jun 2016 19:33:14 +0000 (07:33 +1200)] 
Bug 4523: smblib compile fails on NetBSD

8 years agoPolish: remove unnecessary 'this->' usage in LockingPointer
Amos Jeffries [Thu, 30 Jun 2016 18:10:33 +0000 (06:10 +1200)] 
Polish: remove unnecessary 'this->' usage in LockingPointer

8 years agoCleanup: use C++11 auto when starting ::Server jobs
Amos Jeffries [Thu, 30 Jun 2016 12:37:25 +0000 (00:37 +1200)] 
Cleanup: use C++11 auto when starting ::Server jobs

8 years agoBug 4376: clang cannot build Squid eCAP code
Patrick Welche [Wed, 29 Jun 2016 17:24:24 +0000 (11:24 -0600)] 
Bug 4376: clang cannot build Squid eCAP code

This change is not needed for libecap v1.0 that uses tr1::shared_ptr.
However, libecap is being updated to use std::shared_ptr. Once that
update is complete, Squid eCAP code will no longer compile because the
implicit conversion of shared_ptr to bool in tr1 was deemed dangerous
and, hence, made "explicit" when shared_ptr became standard. Unlike "if"
statements, "return" statements do not trigger an explicit conversion.

8 years agoRemove UnaryFunctor as well, use std::function instead
Amos Jeffries [Wed, 29 Jun 2016 10:44:40 +0000 (22:44 +1200)] 
Remove UnaryFunctor as well, use std::function instead

8 years agosecurity_file_certgen: convert xfree_char to UnaryFunctor xfree_functor
Amos Jeffries [Tue, 28 Jun 2016 12:57:49 +0000 (00:57 +1200)] 
security_file_certgen: convert xfree_char to UnaryFunctor xfree_functor

8 years agoRename UniaryFunctor to UnaryFunctor
Amos Jeffries [Tue, 28 Jun 2016 12:37:16 +0000 (00:37 +1200)] 
Rename UniaryFunctor to UnaryFunctor

8 years agoClang does not provide a global nullptr_t symbol
Amos Jeffries [Mon, 27 Jun 2016 15:54:25 +0000 (03:54 +1200)] 
Clang does not provide a global nullptr_t symbol

8 years agoMerge form trunk rev.14722
Amos Jeffries [Sun, 26 Jun 2016 15:30:29 +0000 (03:30 +1200)] 
Merge form trunk rev.14722

8 years agoFix build error in ESI after rev.14721
Amos Jeffries [Sun, 26 Jun 2016 15:29:44 +0000 (03:29 +1200)] 
Fix build error in ESI after rev.14721

8 years agoMerged from trunk rev.14721
Amos Jeffries [Sun, 26 Jun 2016 14:11:59 +0000 (02:11 +1200)] 
Merged from trunk rev.14721

8 years agoRename CtoCppDtor() as UniaryFunctor()
Amos Jeffries [Sun, 26 Jun 2016 10:41:32 +0000 (22:41 +1200)] 
Rename CtoCppDtor() as UniaryFunctor()

Update the filename, and output functor name suffix to match.

8 years agoRemove last remains of TidyPointer
Amos Jeffries [Sat, 25 Jun 2016 18:02:09 +0000 (06:02 +1200)] 
Remove last remains of TidyPointer

8 years agoRestore old move-assignment definition
Amos Jeffries [Sat, 25 Jun 2016 15:23:43 +0000 (03:23 +1200)] 
Restore old move-assignment definition

We cannot use the compilers default move assignment operator since we
have custom deletePointer() happening in the reset() call.