]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
13 years agoBug 3526: permit high-speed nonce regeneration
Frederic Bourgeois [Tue, 19 Jun 2012 02:24:57 +0000 (20:24 -0600)] 
Bug 3526: permit high-speed nonce regeneration

13 years agoBug 2138: NTLM passthrough using accel cache_peer and ssl
Juan [Tue, 19 Jun 2012 02:23:37 +0000 (20:23 -0600)] 
Bug 2138: NTLM passthrough using accel cache_peer and ssl

13 years agoDrop dead include from xusleep.c
Amos Jeffries [Tue, 19 Jun 2012 01:45:51 +0000 (19:45 -0600)] 
Drop dead include from xusleep.c

13 years agoCleanup: remove xcountws() function
Amos Jeffries [Tue, 19 Jun 2012 01:41:22 +0000 (19:41 -0600)] 
Cleanup: remove xcountws() function

Reduces dependencies and removes one more unnecessary symbol

13 years agoRFC 6585 extends HTTP
Amos Jeffries [Tue, 19 Jun 2012 01:39:44 +0000 (19:39 -0600)] 
RFC 6585 extends HTTP

13 years agoBug 3405: ssl_crtd crashes failing to remove certificate
Alex Rousskov [Sat, 16 Jun 2012 02:19:41 +0000 (20:19 -0600)] 
Bug 3405: ssl_crtd crashes failing to remove certificate

13 years agoBug 3561: cbdata cookie assertion after bug 3505 fix.
Alex Rousskov [Wed, 13 Jun 2012 04:41:19 +0000 (22:41 -0600)] 
Bug 3561: cbdata cookie assertion after bug 3505 fix.

13 years agoPrep for 3.1.20
Amos Jeffries [Fri, 8 Jun 2012 11:01:05 +0000 (05:01 -0600)] 
Prep for 3.1.20

13 years agoRevert auto-maintenance mistake revno11566
Amos Jeffries [Fri, 8 Jun 2012 10:01:28 +0000 (04:01 -0600)] 
Revert auto-maintenance mistake revno11566

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 5 Jun 2012 11:27:52 +0000 (05:27 -0600)] 
SourceFormat Enforcement

13 years agoSourceLayout: convert hash.c to hash.cc
Amos Jeffries [Mon, 4 Jun 2012 11:13:50 +0000 (05:13 -0600)] 
SourceLayout: convert hash.c to hash.cc

Fix compiler identified C'isms. No other changes.

13 years agoBug 3013: segmentation fault on shutdown commSetCloseOnExec at comm.cc:1889
Christos Tsantilas [Mon, 4 Jun 2012 11:10:49 +0000 (05:10 -0600)] 
Bug 3013: segmentation fault on shutdown commSetCloseOnExec at comm.cc:1889

13 years agoBug 3233: Invalid URL accepted with url host is white spaces
Amos Jeffries [Mon, 4 Jun 2012 11:06:45 +0000 (05:06 -0600)] 
Bug 3233: Invalid URL accepted with url host is white spaces

13 years agoBug 3074: Improper URL handling with empty path (RFC 3986)
Fyodor [Mon, 4 Jun 2012 11:04:55 +0000 (05:04 -0600)] 
Bug 3074: Improper URL handling with empty path (RFC 3986)

13 years agoBug 3463: dnsserver fails to compile
Christos Tsantilas [Mon, 4 Jun 2012 11:03:27 +0000 (05:03 -0600)] 
Bug 3463: dnsserver fails to compile

13 years agoBug 3390: Proxy auth data visible to scripts
Francesco Chemolli [Mon, 4 Jun 2012 11:01:11 +0000 (05:01 -0600)] 
Bug 3390: Proxy auth data visible to scripts

13 years agoBug 3537: polish StatHist copy to avoid memory errors
Timo Teras [Mon, 4 Jun 2012 10:56:52 +0000 (04:56 -0600)] 
Bug 3537: polish StatHist copy to avoid memory errors

13 years agoPass external_acl_type credentials to ICAP
Dan Searle [Mon, 4 Jun 2012 10:54:52 +0000 (04:54 -0600)] 
Pass external_acl_type credentials to ICAP

Pass user credentials obtained from external ACLs to the ICAP service
using Proxy-Authorization and X-Client-Username ICAP headers.

13 years agoBug #3380: Mac OSX compile errors with CMSG_SPACE
Dmitry Kurochkin [Mon, 4 Jun 2012 10:52:56 +0000 (04:52 -0600)] 
Bug #3380: Mac OSX compile errors with CMSG_SPACE

13 years agoExtend g++ compatibility for extern inline functions
Francesco Chemolli [Mon, 4 Jun 2012 10:51:31 +0000 (04:51 -0600)] 
Extend g++ compatibility for extern inline functions

13 years agoDefine PRIuSIZE for displaying size_t
Amos Jeffries [Mon, 4 Jun 2012 10:50:34 +0000 (04:50 -0600)] 
Define PRIuSIZE for displaying size_t

This allows us to avoid casting size_t to long long for printf.

./configure script auto-detects the supposedly standard %zu macro in case
it is missing and compat/types.h defines some alternatives for systems
which do not define it.

13 years agoWindows: Disable WCCP, WCCPv2, DiskDaemon by default on MinGW
Francesco Chemolli [Mon, 4 Jun 2012 10:49:47 +0000 (04:49 -0600)] 
Windows: Disable WCCP, WCCPv2, DiskDaemon by default on MinGW

13 years agoWindows: Support DiskIO AIO on Win32
Francesco Chemolli [Mon, 4 Jun 2012 10:49:01 +0000 (04:49 -0600)] 
Windows: Support DiskIO AIO on Win32

13 years agoWindows: Implemented working check for libiphlpapi
Francesco Chemolli [Mon, 4 Jun 2012 10:39:46 +0000 (04:39 -0600)] 
Windows: Implemented working check for libiphlpapi

13 years agoBug 2885: AIX: check and set required compiler flags
Karl Benoit [Mon, 4 Jun 2012 10:27:26 +0000 (04:27 -0600)] 
Bug 2885: AIX: check and set required compiler flags

13 years agoAdd support for TLSv1.1 and TLSv1.2 options and methods
Amos Jeffries [Mon, 4 Jun 2012 10:25:03 +0000 (04:25 -0600)] 
Add support for TLSv1.1 and TLSv1.2 options and methods

When OpenSSL v1.0.1+ is being built against.

Also update the documentation for sslproxy_version which was not
mentioning what the supported version codes were.

Future work:
* make version config option(s) accept a set of named versions and
  convert to codes internally.
* redesign how version and options are handled. Admin should be able to
  just list the TLSv* wanted and Squid figure out the appropriate options
  from there.

13 years agoSourceLayout: port config and select-loop priority polishing
Amos Jeffries [Mon, 4 Jun 2012 10:23:57 +0000 (04:23 -0600)] 
SourceLayout: port config and select-loop priority polishing

- renames http_port_list to AnyP::PortCfg
- de-duplicate https_port_list into AnyP::PortCfg
- shuffles related globals and defines into anyp/PortCfg.*
- renames MAXHTTPPORTS to MAXTCPLISTENPORTS to suit its actual coverage of HTTP and HTTPS ports.
- shuffled config port clone function into a method.
- rename ICP/HTCP/SNMP API functions to consistent *OpenPorts() and *ClosePorts()

  NP:following applies to incoming_* and *_poll_cnt directives.
- renames *_icp_* to *_udp_*
- renames *_http_* to *_tcp_*
- shuffles duplicated struct SquidConf options into a shared structure
- shuffles related defines into comm/Loops.h
- documents options better

- various other cosmetic syntax tweaks and polish

One bug fix:
  comm_dns_incoming was not being propigated in StatsHist copy/clone.
  Now is. I seem to remember mention of something similar being zero before,
  but can't find the bug report.

13 years agoBootstrapped
Automatic source maintenance [Wed, 30 May 2012 00:24:55 +0000 (18:24 -0600)] 
Bootstrapped

13 years agoBug 3526: digest authentication crash
Frederic Bourgeois [Mon, 28 May 2012 06:35:37 +0000 (00:35 -0600)] 
Bug 3526: digest authentication crash

13 years agoBug 3545: FreeBSD dnsserver segfaults
Marcin Wisnicki [Mon, 28 May 2012 06:32:10 +0000 (00:32 -0600)] 
Bug 3545: FreeBSD dnsserver segfaults

13 years agoBug 3186: Digest auth caches failed state without revalidating
Will Roberts [Mon, 28 May 2012 06:30:39 +0000 (00:30 -0600)] 
Bug 3186: Digest auth caches failed state without revalidating

13 years agoPortability fix: remove GNU-specific syntax
Amos Jeffries [Mon, 28 May 2012 06:28:43 +0000 (00:28 -0600)] 
Portability fix: remove GNU-specific syntax

detected by clang++.

13 years agoBug 3537: statistics histogram leaks memory
Timo Teras [Mon, 21 May 2012 03:59:19 +0000 (21:59 -0600)] 
Bug 3537: statistics histogram leaks memory

13 years agoLog TCP_REDIRECT when Squid generates a 300-399 status response
Amos Jeffries [Mon, 21 May 2012 03:52:08 +0000 (21:52 -0600)] 
Log TCP_REDIRECT when Squid generates a 300-399 status response

To identify when 3xx is received from upstream or generated by Squid.

3xx from servers or ICAP/eCAP will continue to use TCP_MISS
and other status codes.

13 years agoBug 3466: Adaptation stuck on last single-byte body piece
Alex Rousskov [Mon, 21 May 2012 02:57:33 +0000 (20:57 -0600)] 
Bug 3466: Adaptation stuck on last single-byte body piece

Changed StoreEntry::bytesWanted(range) to return range.end when the entry can
accommodate range.end bytes. This makes it possible to use that method for
single-byte ranges. Old code returned zero for such ranges, which was
difficult to distinguish from situations where no bytes were wanted at all.

TODO: The StoreEntry::bytesWanted(range) API is left undocumented because it
seems to be slightly broken and/or inconsistent with callers and with the
DelayId::bytesWanted(min, max) API. AFAICT, we should convert
StoreEntry::bytesWanted API from range-based to min/max-based or even just
max-based.

Store Entry API does not use the lower end of the range (except for the
now-removed assertion that the range is not empty). I suspect that Store API
was meant to be used with (first, last+1) "byte position" parameters (returning
the number of bytes wanted) while the DelayId API was meant to be used with
(min, max) "number of bytes" parameters.  However, StoreEntry::bytesWanted
implementation does not follow this assumption so perhaps my speculation is
wrong and there are more problems, including this change.

13 years agoRegister status 308 permanent redirect
Amos Jeffries [Mon, 21 May 2012 02:35:41 +0000 (20:35 -0600)] 
Register status 308 permanent redirect

* relay "Permanent Redirect" message on status line
* MAY cache these responses with heuristics
* accept this status as a redirect status from URL redirectors

13 years agoBug 3258: Requests hang when Host forgery verify fails
Guy Helmer [Sat, 5 May 2012 23:55:14 +0000 (17:55 -0600)] 
Bug 3258: Requests hang when Host forgery verify fails

13 years agoMark verified intercept traffic correctly after DNS lookup
Alexander Komyagin [Sat, 5 May 2012 23:53:44 +0000 (17:53 -0600)] 
Mark verified intercept traffic correctly after DNS lookup

13 years agoBug 3484: Docs: sslproxy_cert_error example flawed
Alex Rousskov [Sun, 15 Apr 2012 04:55:34 +0000 (22:55 -0600)] 
Bug 3484: Docs: sslproxy_cert_error example flawed

Synced ACL name after ACL type change.

This is still far from perfect because dstdomain is not really a FAST ACL
either: Its documentation says that it becomes slow on IP addresses.

13 years ago3.2.0.17 SQUID_3_2_0_17
Amos Jeffries [Thu, 12 Apr 2012 13:42:36 +0000 (07:42 -0600)] 
3.2.0.17

13 years agoBug 3484: Docs: sslproxy_cert_error example flawed
Guy Helmer [Thu, 12 Apr 2012 13:29:28 +0000 (07:29 -0600)] 
Bug 3484: Docs: sslproxy_cert_error example flawed

13 years agoTypo in cachemgr CGI manual
Amos Jeffries [Thu, 12 Apr 2012 13:28:02 +0000 (07:28 -0600)] 
Typo in cachemgr CGI manual

13 years agoBug 3441: Part 3: Replace corrupted v1 swap.state with new v2 format.
Alex Rousskov [Wed, 11 Apr 2012 09:45:41 +0000 (03:45 -0600)] 
Bug 3441: Part 3: Replace corrupted v1 swap.state with new v2 format.

A fix for bug 3408 changed the offset at which we start writing dirty
swap.state entries from StoreSwapLogHeader::record_size to StoreSwapLogHeader
size.  However, the log-reading code still read the entries starting from the
old offset (which is required to remain compatible with how a clean swap.state
is written).

Wrong starting offset essentially means that the vast majority of read
swap.state entries were bogus. They could only match some real entry when 64*n
is divisible by 12 and perhaps when their random data just happened to match a
real entry. Part 2 of this bug fix (trunk r11995) started to pad the [dirty]
swap.state header to start entry writing at StoreSwapLogHeader::record_size
boundary.

Changes specific to Part 3:

Unfortunately, since old v1 logs could contain completely bogus entries as the
result of being read (at some point) from the wrong offset, we should not load
v1 logs any more (neither dirty nor clean because what looks clean now could
be based on a previously dirty and, hence, corrupted log). This forced us to
raise the swap.state format version from 1 to 2.

After this change, if a v1 swap log is detected, Squid ignores it and does a
from-directory rebuild as if no swap.state files were found.

Since we had to change swap.state format version, we also made log entry size
and composition the same across virtually all platforms; added checksums so
that a similar bug would not go unnoticed for so long (and would not result in
log corruption); and increased the size of time-related entries to avoid the
"year 2038" problem.

The swap log entries are still written to disk in host byte order.

We now also zero the [dirty] swap.state header padding to prevent random and
potentially sensitive garbage in logs.

Cache index rebuild kinds are now reported using the following three labels:

* Rebuild using a swap log created by Squid during clean shutdown: "clean log"
* Rebuild using a swap log accumulated by a running Squid: "dirty log"
* Rebuild using directory scan: "no log"

The first kind used to be reported as CLEAN and the other two as DIRTY rebuild.

13 years agoBug 3527: EUI compile errors on Mac OS X 10.5.8 PPC
Amos Jeffries [Wed, 11 Apr 2012 09:40:35 +0000 (03:40 -0600)] 
Bug 3527: EUI compile errors on Mac OS X 10.5.8 PPC

13 years agoBug 3505: crash in CbcPointer<Comm::ConnOpener> constructor
Alex Rousskov [Tue, 10 Apr 2012 12:14:30 +0000 (06:14 -0600)] 
Bug 3505: crash in CbcPointer<Comm::ConnOpener> constructor

13 years agoNULL defined by our compat/types.h
Amos Jeffries [Tue, 10 Apr 2012 12:12:50 +0000 (06:12 -0600)] 
NULL defined by our compat/types.h

13 years agoPolish: de-duplicate UDP port dialers
Amos Jeffries [Tue, 10 Apr 2012 12:12:00 +0000 (06:12 -0600)] 
Polish: de-duplicate UDP port dialers

This create a Comm::UdpOpenDialer class which replaces the ICP, HTCP and
SNMP start-listening dialer classes. Their code was very close to
identical anyway.

ICP and HTCP can now also use the dialer Comm::Connection parameter
instead of assuming that the callback relates to the global incoming
port variable.

13 years agoBug 3193: NTLM decoder truncating strings
Amos Jeffries [Tue, 10 Apr 2012 12:08:32 +0000 (06:08 -0600)] 
Bug 3193: NTLM decoder truncating strings

* Also ntlm_unpack_auth using reversed arguments for memcpy()
* Also improved packet structure debug display

13 years agoMaintenance: ensure stub_* files are always bundled
Amos Jeffries [Mon, 2 Apr 2012 02:50:41 +0000 (20:50 -0600)] 
Maintenance: ensure stub_* files are always bundled

Relying on dependency chains does not always work for stubs.
Builds automake list of files to bundle and add to EXTRA_DIST for
bundling.

13 years agoBug 3397: do not mark connection as opened until after SYN-ACK
Amos Jeffries [Mon, 2 Apr 2012 02:33:40 +0000 (20:33 -0600)] 
Bug 3397: do not mark connection as opened until after SYN-ACK

assertion failed: comm.cc:1117: "isOpen(fd)" on FwdState destruct with
half-connected server. When the SYN was sent but ACK not yet received.

13 years agoSolaris: definitions of AF_LOCAL and strsep()
Jose-Marcio Martins da Cruz [Fri, 16 Mar 2012 00:57:44 +0000 (18:57 -0600)] 
Solaris: definitions of AF_LOCAL and strsep()

13 years agoSolaris: Dist the krb5 patch
Amos Jeffries [Fri, 16 Mar 2012 00:56:45 +0000 (18:56 -0600)] 
Solaris: Dist the krb5 patch

13 years agoSolaris: define SUN_LEN()
Alexander Lukyanov [Fri, 16 Mar 2012 00:55:26 +0000 (18:55 -0600)] 
Solaris: define SUN_LEN()

13 years agoWindows: use Comm::Connection ICP sockets
Amos Jeffries [Fri, 16 Mar 2012 00:54:17 +0000 (18:54 -0600)] 
Windows: use Comm::Connection ICP sockets

13 years agoWindows: Use FD_ISSET() wrapper instead of __WSAFDIsSet()
Amos Jeffries [Fri, 16 Mar 2012 00:53:30 +0000 (18:53 -0600)] 
Windows: Use FD_ISSET() wrapper instead of __WSAFDIsSet()

This moves the Win32-specific select() module a lot closer to the
non-Windows select() module.

13 years agoBug 3263: ssl_crtd: undefined references to squid_curtime
Alex Rousskov [Fri, 16 Mar 2012 00:52:11 +0000 (18:52 -0600)] 
Bug 3263: ssl_crtd: undefined references to squid_curtime

13 years agoBug 3439: correct external_acl_type documented default for ipv4/ipv6 option
Amos Jeffries [Fri, 16 Mar 2012 00:50:40 +0000 (18:50 -0600)] 
Bug 3439: correct external_acl_type documented default for ipv4/ipv6 option

13 years agoBug 3509: kQueue compile error
Warren Baker [Wed, 7 Mar 2012 12:38:31 +0000 (05:38 -0700)] 
Bug 3509: kQueue compile error

13 years ago3.2.0.16 SQUID_3_2_0_16
Amos Jeffries [Wed, 7 Mar 2012 02:41:56 +0000 (19:41 -0700)] 
3.2.0.16

13 years agoBug 3458: Icon Serving (squid-internal-static) Broken
Alex Rousskov [Wed, 7 Mar 2012 02:33:35 +0000 (19:33 -0700)] 
Bug 3458: Icon Serving (squid-internal-static) Broken

13 years agoBug 3420: Request body consumption races and theConsumer
Alex Rousskov [Wed, 7 Mar 2012 00:40:42 +0000 (17:40 -0700)] 
Bug 3420: Request body consumption races and theConsumer

13 years agoBug 3508: Correct DNS timeout handling.
Henrik Nordstrom [Wed, 7 Mar 2012 00:37:37 +0000 (17:37 -0700)] 
Bug 3508: Correct DNS timeout handling.

The change to concurrent A & AAAA lookups did not handle timeouts
properly, resulting in segmentation faults.

The timeouts as such were also mismanaged, resulting in much longer
DNS timeouts than intended.

This also cleans up the API somewhat to use const for the result.

13 years agoBreak out assignment from if clause to make code more readable (and gcc happier)
Henrik Nordstrom [Wed, 7 Mar 2012 00:35:22 +0000 (17:35 -0700)] 
Break out assignment from if clause to make code more readable (and gcc happier)

13 years agoBug 3457: Display TLS error details in ERR_SECURE_CONNECT_FAIL
Amos Jeffries [Wed, 7 Mar 2012 00:33:32 +0000 (17:33 -0700)] 
Bug 3457: Display TLS error details in ERR_SECURE_CONNECT_FAIL

13 years agoTranslations: Sync with 3.HEAD
Various Translators [Sun, 4 Mar 2012 03:49:13 +0000 (20:49 -0700)] 
Translations: Sync with 3.HEAD

13 years agoBug 3503: DNS PTR queries timeout due to wrong QIDs.
Alex Rousskov [Sat, 3 Mar 2012 23:57:44 +0000 (16:57 -0700)] 
Bug 3503: DNS PTR queries timeout due to wrong QIDs.

Supply query ID (rather than zero) to rfc3596BuildPTRQuery*() calls.

This code was broken since trunk r11015 "Fixed DNS query leaks and increased
defense against DNS cache poisoning" dated 2010-11-03.

13 years agoRegression: snmp/udp address directives not resolving hostname
Amos Jeffries [Sat, 3 Mar 2012 23:56:06 +0000 (16:56 -0700)] 
Regression: snmp/udp address directives not resolving hostname

13 years agoBetter helper-to-Squid buffer size management.
Alex Rousskov [Sat, 3 Mar 2012 23:54:41 +0000 (16:54 -0700)] 
Better helper-to-Squid buffer size management.

The minimum buffer size is reduced from 8KB to 4KB after a squid-dev
discussion to prevent wasting of "several hundred KB of unused permanent
memory on some installations".

We now increase the buffer if we cannot parse the helper response message.

The maximum buffer size is now 32KB. This should be enough for all known
helper responses.

We now warn if the read buffer reaches its capacity and kill the offending
helper explicitly. An increase in maximum buffer capacity to 32KB should make
such events rare.

Motivation: ssl_crtd helper may produce responses exceeding 9907 bytes in size
(and possibly much larger if multiple chained certificates need to be returned
to Squid). The old helper.cc code would fill the read buffer completely,
schedule a read for zero bytes, receive zero bytes, declare an EOF condition,
and close the stream (which kills ssl_crtd).  Due to insufficient information
logged, the observable symptoms were pretty much the same as if ssl_crtd
closed the stream first, indicating a ssl_crtd bug.

13 years agoBug 3502: client timeout uses server-side read_timeout, not request_timeout
HONDA Hirofumi [Sat, 3 Mar 2012 23:43:53 +0000 (16:43 -0700)] 
Bug 3502: client timeout uses server-side read_timeout, not request_timeout

Also adjusts request_timeout description in squid.conf to clarify that
request_timeout applies to receiving complete HTTP request headers and not
just the first header byte or body. We reset the connection timeout to
clientLifetimeTimeout after parsing request headers.

https_port was correctly using Config.Timeout.request already.

13 years agoBug 3497: Bad ssl_crtd db size file causes infinite loop
Guy Helmer [Sat, 3 Mar 2012 23:38:55 +0000 (16:38 -0700)] 
Bug 3497: Bad ssl_crtd db size file causes infinite loop

The db size file may become empty when Squid runs out of disk space. Ignoring
db size reading errors led to bogus db sizes used as looping condition. This
fix honors reading errors and also terminates the loop when no more
certificates can be removed. Both errors and removal failure are fatal to
ssl_crtd.

A positive side-effect of this fix is one less call to the relatively
expensive file-reading size()/readSize() methods under normal conditions.

I also removed "minimum db size" check because it did not seem to be in sync
with other ssl_crtd parameters such as fs block size and because its overall
purpose was unclear. The check was also removed by the original bug reporter.

TODO: Remaining problems include: ssl_crtd should not exit just because it
cannot write something to disk. A proper reporting/debugging API is missing.

13 years agoLog '-' on requests with no Referer or User-Agent headers
Amos Jeffries [Sat, 3 Mar 2012 23:36:04 +0000 (16:36 -0700)] 
Log '-' on requests with no Referer or User-Agent headers

This data is actually meaningful for the analysis of client behaviour.

squid-dev have agreed that it is worth removing the old log behaviour of
omitting these entries.

13 years agoFix IPv6 site-local IP detection
Amos Jeffries [Sat, 3 Mar 2012 23:35:08 +0000 (16:35 -0700)] 
Fix IPv6 site-local IP detection

RFC 4193 the site-local allocated range is fc00::/7.

Squid has been using IN6_IS_ADDR_SITELOCAL() but it turns out Linux and
OpenBSD at least still define that to test for the long obsolete fec0::/10.

13 years agoBug 3490: Crash writing Apache Common and Referer/Username logs
Amos Jeffries [Sat, 3 Mar 2012 23:34:13 +0000 (16:34 -0700)] 
Bug 3490: Crash writing Apache Common and Referer/Username logs

13 years agoBug 3381: 32-bit overflow assertion in StatHist
Francesco Chemolli [Sat, 3 Mar 2012 23:19:03 +0000 (16:19 -0700)] 
Bug 3381: 32-bit overflow assertion in StatHist

- StatHist refactoring
- StatCounters untangling from global symbol table
- Added StatHist unit tests, and moved algorithm consistency checks there.
- Expanded storage for histograms to 64-bit unsigned. (bug 3381)
- Inlined StatHist constructor, destructor and assignment operator.
- added protection against self-assignment
- Implemented stubs for StatHist.cc and mem.cc

13 years agoRetry requests that failed due to a persistent connection race
Alex Rousskov [Sat, 25 Feb 2012 04:32:57 +0000 (21:32 -0700)] 
Retry requests that failed due to a persistent connection race

... instead of replying with ERR_ZERO_SIZE_OBJECT "Bad Gateway".

The ERR_ZERO_SIZE_OBJECT errors were visible to the client when the
destination had only one address because serverDestinations.shift()
made the list of destination empty and startConnectionOrFail() failed.

When FwdState starts to use a pinned connection, the connection is treated as
an idle persistent connection as far as race detection is concerned.
Currently, pinned connections cannot be reopened, repinned, and retried after
a pconn race. This will change when server-side bumped connections become
pinned.

It felt wrong that a failed serverConn may remain set while we are opening a
new connection so I set it to NULL after a squid-dev discussion indicating
that doing so should be safe.

We also now reset the local port number to zero in case it was set to the
actual source port by ConnOpener or other code working with the previous
connection to the same serverDestinations[0] address, although simple tests
worked (and showed changing source port) without this reset.

13 years agoFix sslpassword_program for ssl-bump http ports
Christos Tsantilas [Sat, 25 Feb 2012 04:29:46 +0000 (21:29 -0700)] 
Fix sslpassword_program for ssl-bump http ports

Currently the sslpassword_program configuration parameter does not work
for encrypted certificate keys on ssl-bump enabled http ports, and user
always asked to give the SSL key password.

This patch fixes this problem.

This is a Measurement Factory project.

13 years agoSupport CoAP over HTTP
Amos Jeffries [Sat, 25 Feb 2012 04:28:08 +0000 (21:28 -0700)] 
Support CoAP over HTTP

Make Squid happy with HTTP requests using coap:// and coaps:// URI.

No gateway or other interaction with CoAP is enabled by this patch.

13 years agoBug 3324: loadFromFile: parse error while reading template file
Alex Rousskov [Sat, 25 Feb 2012 04:27:06 +0000 (21:27 -0700)] 
Bug 3324: loadFromFile: parse error while reading template file

Do not store and later use a pointer to a temporary String buffer.
HttpHeader::getByName() returns a temporary String.

13 years agoDrop old keep-alive hack for Netscape
Amos Jeffries [Sat, 25 Feb 2012 04:24:53 +0000 (21:24 -0700)] 
Drop old keep-alive hack for Netscape

13 years agoDo not cache partially loaded entries in shared mem cache (and then serve them)
Alex Rousskov [Sat, 25 Feb 2012 04:21:24 +0000 (21:21 -0700)] 
Do not cache partially loaded entries in shared mem cache (and then serve them)

When handling a conditional request, Squid may load the beginning of a cached
object from disk, realize that the client has the same fresh copy, and respond
with 304 Not Modified. After that, Squid was checking whether the partially
loaded object should be kept in shared memory cache (if enabled). There were
no checks preventing memory caching of the partially loaded object.

Later, partially cached objects were served to clients, resulting in truncated
responses. I believe this happens because shared memory cache does not keep
all the StoreEntry data (just like a disk cache does not do that) so the fact
that only a part of the object was available was lost.

13 years agoDo not swap out already swapped out objects.
Alex Rousskov [Sat, 25 Feb 2012 04:20:25 +0000 (21:20 -0700)] 
Do not swap out already swapped out objects.

I noticed that sometimes Squid would start swapping out an entry that was
recently loaded from disk and was still on disk. That wastes disk
resources (at best).

The old StoreEntry::mayStartSwapOut() code assumed that when swap_status is
not SWAPOUT_NONE it is SWAPOUT_WRITING, but SWAPOUT_WRITING is impossible
after recent StoreEntry::swapOut() modifications because mayStartSwapOut() is
only called when we are not swappingOut() already. SWAPOUT_DONE is possible.

13 years agoDrop dead code in reply parsing
Amos Jeffries [Sat, 25 Feb 2012 04:19:26 +0000 (21:19 -0700)] 
Drop dead code in reply parsing

This code has not been used/needed in some time. It can die.

It is also no clear why it existed in the first place. The RFC is not
mentioned by number and RFC 2068/2616 only talk about tolerance for
whitespace before request lines, not replies.

13 years agoBug 3490: part 1: SegFault opening FTP active data connections
Amos Jeffries [Sat, 25 Feb 2012 04:18:44 +0000 (21:18 -0700)] 
Bug 3490: part 1: SegFault opening FTP active data connections

13 years agoAdd debugs for NTLM domain decode errors
Amos Jeffries [Sat, 25 Feb 2012 04:15:22 +0000 (21:15 -0700)] 
Add debugs for NTLM domain decode errors

13 years agoSourceLayout: shuffle CommIO into DiskThreads library
Amos Jeffries [Sat, 25 Feb 2012 04:14:25 +0000 (21:14 -0700)] 
SourceLayout: shuffle CommIO into DiskThreads library

While investigating the Windows port problems it became clear that the
CommIO object is not actually related to the rest of comm systems. It is
instead a dedicated higher level disk I/O pipe manager for DiskThreads.

Given that it causes build errors in comm.cc on Windows and does not
even need to be there this patch shuffles it into the DiskThreads
library. The build issues on Windows still exist but are now limited to
just that threads library and can be avoided temporarily with simple
./configure options.

13 years ago3.2.0.15 SQUID_3_2_0_15
Amos Jeffries [Sun, 5 Feb 2012 13:27:27 +0000 (06:27 -0700)] 
3.2.0.15

13 years agoPrep for 3.1.19 and 3.2.0.15
Amos Jeffries [Sun, 5 Feb 2012 11:43:06 +0000 (04:43 -0700)] 
Prep for 3.1.19 and 3.2.0.15

13 years agoSilence messages about MGR_INDEX when not installed
Amos Jeffries [Sun, 5 Feb 2012 11:37:57 +0000 (04:37 -0700)] 
Silence messages about MGR_INDEX when not installed

13 years agoBug 3441: part 2: Prevent further cache size corruption of swap.state
Alex Rousskov [Sun, 5 Feb 2012 07:29:54 +0000 (00:29 -0700)] 
Bug 3441: part 2: Prevent further cache size corruption of swap.state

13 years agoFixed debugging line: '<<' has higher precedence than '?:'.
Alex Rousskov [Sun, 5 Feb 2012 06:37:08 +0000 (23:37 -0700)] 
Fixed debugging line: '<<' has higher precedence than '?:'.

13 years agoBug 3478: pt1: Host verify catching dynamic CDN hosted sites
Amos Jeffries [Sun, 5 Feb 2012 06:35:38 +0000 (23:35 -0700)] 
Bug 3478: pt1: Host verify catching dynamic CDN hosted sites

This add a bit more leniency to the Host: header validation without
re-opening Squid to the cache poisoning risks involved.Resolving most
issues with websites using geo-based DNS results and/or short DNS TTL for
load balancing.

It alters host_verify_strict directive to allow requests which fail Host:
validation to continue through processing. The default remains OFF.

* blocks caching on the response to protect all other network clients
  against one compromised client spreading infections.

* forces the original (untrusted) destination IP to be used instead of
  any alternative Squid might find. Preventing Squid or peer DNS lookup
  being the point of vulnerability for the same-origin bypass. For any
  client to be vulnerable it must be vulnerable inside the browser agent
  where the original TCP connection is established.

Also add a new error template ERR_CONFLICT_HOST to replace the confusing
"invalid request" message with a clear explanation of the problem and
some client workarounds.

FUTURE WORK:
* adapt processing to allow these requests to safely be passed to peers.
* adapt caching to permit safe sharing between clients making identical
  requests to same sources.

13 years agoRenamed squid.h to squid-old.h and config.h to squid.h
Francesco Chemolli [Sun, 5 Feb 2012 06:09:46 +0000 (23:09 -0700)] 
Renamed squid.h to squid-old.h and config.h to squid.h

13 years agoBug 3441: Part 1: Minimize cache size corruption by malformed swap.state.
Alex Rousskov [Thu, 2 Feb 2012 08:48:59 +0000 (01:48 -0700)] 
Bug 3441: Part 1: Minimize cache size corruption by malformed swap.state.

If swap.state gets corrupted, a single entry with bogus size value will screw
up Squid idea of the current cache size. A newly added StoreSwapLogData sane()
method attempts to minimize the chance of corruption by ignoring log entries
with obviously bogus values.

However, without expensive size checks (-S or "Does the log entry matches the
actual cache file size?"), it is not possible to reliably detect all bogus log
entries.

If Squid gets a wrong idea of the current cache size, it may either cache too
much (and possibly run out of space) OR delete everything.

13 years agoBug 3268: remove wrong 'Ready to serve requests.' message
Amos Jeffries [Fri, 27 Jan 2012 13:42:36 +0000 (06:42 -0700)] 
Bug 3268: remove wrong 'Ready to serve requests.' message

13 years agoBug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)
Alex Rousskov [Fri, 27 Jan 2012 13:03:56 +0000 (06:03 -0700)] 
Bug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)

Properly initialize memory_cache_shared when not explicitly configured and
do not allocate shared memory segments if memory_cache_shared is off.

Prior to this change, shared memory was requested (during rrClaimMemoryNeeds)
before memory_cache_shared was initialized (during rrAfterConfig, unless
explicitly set in squid.conf). Moreover, MemStore::EntryLimit() calculation
ignored memory_cache_shared setting. All that resulted in an attempt to create
shared memory segments where none were needed or possible.

We now have a new Runners Registry (rrFinalizeConfig) that is dedicated to
finalizing complex configuration options, before those configurations options
are used to initialize modules, features, and services. As far as shared
memory is concerned, the initialization order is now:

  * rrFinalizeConfig: finalize memory_cache_shared if needed
  * rrClaimMemoryNeeds: request shared memory pages for the caches
  * rrAfterConfig: create shared memory segments

The same bug 3449 also needed a fix for shared segment paths (trunk r11961).

13 years agoBug 3268: Squid cannot do anything else during ufs/diskd rebuild
Alex Rousskov [Fri, 27 Jan 2012 13:01:52 +0000 (06:01 -0700)] 
Bug 3268: Squid cannot do anything else during ufs/diskd rebuild

Replaced 50-entries/step UFS rebuild logic with 50msec/step logic,
while also ensuring that other events can be processed between steps.

During a swap.state rebuild, progress reporting will now happen
every 4000 entries instead of every 0xFFF entries because humans do not
think in hex. Still no progress reporting for dirty rebuilds based on the
cache directory scans.

The code is based on Rock Store rebuild code. Eventually, the common rebuild
pacing logic among all stores should be merged to avoid code duplication.

Also removed RebuildState::next methods as unused. A copy-paste error?

13 years agoDisable OpenSSL SSL/TLS bug workarounds by default
Henrik Nordstrom [Fri, 27 Jan 2012 12:52:44 +0000 (05:52 -0700)] 
Disable OpenSSL SSL/TLS bug workarounds by default

On a closer inspection the set of "harmless" SSL/TLS bug workarounds
set by SSL_OP_ALL is not all of them harmless and reduces the SSL/TLS
strength to some attacks.

To revert to the older mode the ALL option can be set explicitly, but
it's better to understand which bug is encountered and enable only that
specific workaround if needed.

13 years agoGCC 4.7 fix
Jiri Skala [Fri, 27 Jan 2012 12:51:23 +0000 (05:51 -0700)] 
GCC 4.7 fix

13 years agoSend DNS A and AAAA queries in parallel
Henrik Nordstrom [Fri, 27 Jan 2012 12:47:06 +0000 (05:47 -0700)] 
Send DNS A and AAAA queries in parallel

This implements sending DNS A & AAAA queries in parallel by
creating "slave" idns_query requests. Current implementation
uses the A lookup as "master" and AAAA as "slave" query.

Long term this should probably be restructured to separate "lookup
state" and "query", or even better yet to defer the DNS lookups
until connect time and perform A respective AAAA as needed only and
not look up both before attemting to connect.

This also drops the dns_v4_fallback directive as it have no effect with
parallel DNS lookups. This directive should be reinstanciated in future
to enable pure IPv6 usage.

13 years agotrimMemory for unswappable objects
Christos Tsantilas [Fri, 27 Jan 2012 12:40:00 +0000 (05:40 -0700)] 
trimMemory for unswappable objects

Inside StoreEntry::swapOut() the StoreEntry::trimMemory() method called to
release unused MemObjects memory. The trimMemory method must called for all
store entries, but current code blocks that call for not-swappable objects,
at least.

This patch trying to fix this bug implementing the following simple logic:
   {
     bool weAreOrMayBeSwappingOut =
           swappingOut() || mayStartSwapout();

     trimMemory(weAreOrMayBeSwappingOut);

     if (!weAreOrMayBeSwappingOut)
         return; // nothing else to do
   }

This is a Measurement Factory project