]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
10 years agoRemoved httpHeaderIdByNameDef, small cleanups
Francesco Chemolli [Mon, 3 Aug 2015 13:56:30 +0000 (15:56 +0200)] 
Removed httpHeaderIdByNameDef, small cleanups

10 years agoRemoved HttpHeaderFieldInfo and related methods
Francesco Chemolli [Mon, 3 Aug 2015 10:40:17 +0000 (12:40 +0200)] 
Removed HttpHeaderFieldInfo and related methods

10 years agoMigrate HttpHdrCc to LookupTable.
Francesco Chemolli [Mon, 3 Aug 2015 10:27:49 +0000 (12:27 +0200)] 
Migrate HttpHdrCc to LookupTable.

10 years agoRemove dead code from HttpHdrSc.cc
Francesco Chemolli [Sun, 2 Aug 2015 19:40:58 +0000 (21:40 +0200)] 
Remove dead code from HttpHdrSc.cc

10 years agoReimplemented Surrogate-Control lookup as LookupTable, removed httpHeaderNameById
Francesco Chemolli [Sun, 2 Aug 2015 18:06:48 +0000 (20:06 +0200)] 
Reimplemented Surrogate-Control lookup as LookupTable, removed httpHeaderNameById

10 years agoTurn field_type into a strongly-typed enum
Francesco Chemolli [Sun, 2 Aug 2015 15:09:46 +0000 (17:09 +0200)] 
Turn field_type into a strongly-typed enum

10 years agoMerged from trunk
Francesco Chemolli [Sat, 1 Aug 2015 15:35:37 +0000 (17:35 +0200)] 
Merged from trunk

10 years agoBug 4293: wrong SNI sent to server after URL-rewrite
Alex Wu [Sat, 1 Aug 2015 03:50:37 +0000 (20:50 -0700)] 
Bug 4293: wrong SNI sent to server after URL-rewrite

10 years agoFix 'large transactions are getting stuck' since rev.14093
Amos Jeffries [Sat, 1 Aug 2015 02:22:12 +0000 (19:22 -0700)] 
Fix 'large transactions are getting stuck' since rev.14093

Packer removal of packerClean() also removed several implicit uses of
StoreEntry::flush() without adding an explicit call in their place.

All users of StoreEntry::buffer() must follow it with a call to
StoreEntry:flush() to release the buffering and output the buffer
contents.

10 years agoSourceLayout: move CacheMgr typedef OBJH to mgr/forward.h
Amos Jeffries [Sat, 1 Aug 2015 02:13:13 +0000 (19:13 -0700)] 
SourceLayout: move CacheMgr typedef OBJH to mgr/forward.h

10 years agoMore 3.5.7 ChangeLog
Amos Jeffries [Fri, 31 Jul 2015 21:01:05 +0000 (14:01 -0700)] 
More 3.5.7 ChangeLog

10 years agoPrep for 3.5.7 and 3.4.14
Amos Jeffries [Fri, 31 Jul 2015 20:57:07 +0000 (13:57 -0700)] 
Prep for 3.5.7 and 3.4.14

10 years agoAdd forgotten http/RegisteredHeaders.cc
Francesco Chemolli [Fri, 31 Jul 2015 19:37:37 +0000 (21:37 +0200)] 
Add forgotten http/RegisteredHeaders.cc

10 years agoMerged from trunk
Francesco Chemolli [Fri, 31 Jul 2015 19:26:52 +0000 (21:26 +0200)] 
Merged from trunk

10 years agoUpdated TODO
Francesco Chemolli [Fri, 31 Jul 2015 15:05:22 +0000 (17:05 +0200)] 
Updated TODO

10 years agoMoved headerTable and related enums to RegisteredHeaders.cc
Francesco Chemolli [Fri, 31 Jul 2015 14:42:48 +0000 (16:42 +0200)] 
Moved headerTable and related enums to RegisteredHeaders.cc

10 years agoMoved some users of httpHeaderIdByNameDef to the SBuf variant
Francesco Chemolli [Fri, 31 Jul 2015 14:14:34 +0000 (16:14 +0200)] 
Moved some users of httpHeaderIdByNameDef to the SBuf variant

10 years agoRemoved HeadersAttrs table, moved header statistics to headerStatsTable.
Francesco Chemolli [Fri, 31 Jul 2015 14:05:05 +0000 (16:05 +0200)] 
Removed HeadersAttrs table, moved header statistics to headerStatsTable.

10 years agoMigrate Http Header Fields stats to headerStatsTable
Francesco Chemolli [Fri, 31 Jul 2015 12:53:39 +0000 (14:53 +0200)] 
Migrate Http Header Fields stats to headerStatsTable

10 years agoComment out dead code, start using LookupTable for HttpHeader lookups.
Francesco Chemolli [Fri, 31 Jul 2015 10:28:59 +0000 (12:28 +0200)] 
Comment out dead code, start using LookupTable for HttpHeader lookups.

10 years agobasic_smb_auth: rejecting valid credentials
Unknown - Debian Project [Fri, 31 Jul 2015 06:26:38 +0000 (23:26 -0700)] 
basic_smb_auth: rejecting valid credentials

basic_smb_auth.sh delivers the credentials via environment in
a form "$USER%$PASSWORD", which is not expected from smbclient. This seem to
result from an obsolete or inferior documentation of smbclient. While it is
perfectly valid to deliver the credentials in this form via commandline
parameter -U, for example in

  smbclient //domain_controller/NETLOGON -d 0 -E -W windows_domain -c "get
  proxyauth -" -U herrmann%mysecurepassword 2>/dev/null

this form is not valid, when the credentials will be delivered via environment.

Via environment the credentials must be delivered in two separate variables
  USER=$USER%
  PASSWD=$PASSWORD.

10 years agobasic_smb_auth: doesn't handle passwords with backslashes
Jeff Licquia [Fri, 31 Jul 2015 06:22:11 +0000 (23:22 -0700)] 
basic_smb_auth: doesn't handle passwords with backslashes

 From; Jeff Licquia <jlicquia@scinet.springfieldclinic.com>
 Subject; squid: SMB auth proxy has problems with some passwords
 Date; Tue, 18 Jul 2000 12:45:01 -0500 (CDT)

The SMB authenticator doesn't handle passwords with backslashes in them
correctly.  The fix appears to be easy; just put a -r in the "read SMBPASS"
line in smb_auth.sh.

10 years agobasic_smb_auth: nmblookup fails when smb.conf contaisn WINS servers
John M Cooper [Fri, 31 Jul 2015 06:16:51 +0000 (23:16 -0700)] 
basic_smb_auth: nmblookup fails when smb.conf contaisn WINS servers

 From; John M Cooper
 To; Debian Bug Tracking System
 Subject; squid: smb_auth does not work with a wins server defined in smb.conf
 Date; 28 Jan 2002 17:46:13 +0000

If you define a wins server in the file /etc/samba/smb.conf then the
smb_auth script gets the wrong Domain Controller IP address.

There should be a change to mb_auth.sh at line 50

basically adding in the extra "\..+" stops the number of Wins servers
from being returned from the nmblookup command.

10 years agoDocs: fix man(8) page syntax for lexgrof tool
Amos Jeffries [Fri, 31 Jul 2015 04:49:36 +0000 (21:49 -0700)] 
Docs: fix man(8) page syntax for lexgrof tool

10 years agoCleanup: urlParseProtocol() is unused outside url.cc
Amos Jeffries [Fri, 31 Jul 2015 00:16:40 +0000 (17:16 -0700)] 
Cleanup: urlParseProtocol() is unused outside url.cc

10 years agoAdd todo list, re-add HDR_OTHER, implement parallel lookup, shuffle HDR_BAD_HDR at...
Francesco Chemolli [Thu, 30 Jul 2015 15:01:46 +0000 (17:01 +0200)] 
Add todo list, re-add HDR_OTHER, implement parallel lookup, shuffle HDR_BAD_HDR at end of enum list

10 years agoCheck invariant on HttpHeader.cc:headerTable at startup
Francesco Chemolli [Thu, 30 Jul 2015 13:06:23 +0000 (15:06 +0200)] 
Check invariant on HttpHeader.cc:headerTable at startup

10 years agoLookupTable must be case-insensitive
Francesco Chemolli [Thu, 30 Jul 2015 12:35:58 +0000 (14:35 +0200)] 
LookupTable must be case-insensitive

10 years agoImplement modular LookupTable and use it for HttpHeader.cc:headerTable.
Francesco Chemolli [Thu, 30 Jul 2015 09:19:13 +0000 (11:19 +0200)] 
Implement modular LookupTable and use it for HttpHeader.cc:headerTable.

10 years agoSourceFormat Enforcement
Source Maintenance [Wed, 29 Jul 2015 18:12:16 +0000 (18:12 +0000)] 
SourceFormat Enforcement

10 years agoStart converting HttpHeader.cc to LookupTable
Francesco Chemolli [Wed, 29 Jul 2015 17:23:49 +0000 (19:23 +0200)] 
Start converting HttpHeader.cc to LookupTable

10 years agoMerged from trunk
Francesco Chemolli [Wed, 29 Jul 2015 13:33:12 +0000 (15:33 +0200)] 
Merged from trunk

10 years agoImplement std::hash<SBuf> for seamless std::unordered_map<SBuf,*> integration
Francesco Chemolli [Wed, 29 Jul 2015 13:30:50 +0000 (15:30 +0200)] 
Implement std::hash<SBuf> for seamless std::unordered_map<SBuf,*> integration

10 years agoMoved std::hash<SBuf> from SBuf.h to SBufAlgos.h
Francesco Chemolli [Wed, 29 Jul 2015 13:27:15 +0000 (15:27 +0200)] 
Moved std::hash<SBuf> from SBuf.h to SBufAlgos.h

10 years agoRemoved whitespace in unit test
Francesco Chemolli [Wed, 29 Jul 2015 12:31:56 +0000 (14:31 +0200)] 
Removed whitespace in unit test

10 years agoSourceFormat Enforcement
Source Maintenance [Wed, 29 Jul 2015 12:12:14 +0000 (12:12 +0000)] 
SourceFormat Enforcement

10 years agoSourceLayout: refactor regex pattern objects
Amos Jeffries [Wed, 29 Jul 2015 07:11:17 +0000 (00:11 -0700)] 
SourceLayout: refactor regex pattern objects

* moves the regex pattern state storage to class RegexPattern
  in base/RegexPattern.h which is MEMPROXY_CLASS pooled and
  constructed with flags and pattern preset.
 - for now the regcomp generated data is set separately.

* Replaces ACL storage class RegexList with a std::list

* converts refresh_pattern regex data to class RegexPattern for
  its pattern and -i/+i flag details.

10 years agoFix libdiskio build with auto-disabled modules
Amos Jeffries [Wed, 29 Jul 2015 03:29:17 +0000 (20:29 -0700)] 
Fix libdiskio build with auto-disabled modules

The squid_disk_module_candidates_* autoconf variable for disabled
disk I/O modules needs to be explicitly set to 'no' to perform the
disabling. Do this for all modules that were not doing so when module
dependencies were broken or absent.

Also, convert the IpcIo module from a hard ERROR, to a soft auto-disable
when SHM support is not present.

10 years agoAdd temporary SBufToCstring() helper functions for SBuf transition
Amos Jeffries [Wed, 29 Jul 2015 00:41:57 +0000 (17:41 -0700)] 
Add temporary SBufToCstring() helper functions for SBuf transition

These functions provide safe replacement for xstrdup() and xstrncpy()
that guarantees 0-termination of the output c-string but do not have
any side effects or behaviour guarantees affecting the source SBuf
internal state.

This lack of side effects is important for the transitional period
where a lot of buffer contents will be copied out of SBuf but are
'read-only' and need to avoid overheads such as the reallocating
twice (or more) that would occur if using SBuf::c_str().

Effective immediately we have a ban on using the xstr*() group of
helper functions to copy data out of SBuf::raw*() accessors. The
xstr*() and all other common system str*() use c-string dependent
operations internally which on non-0-terminated SBuf internals can
result in nasty performance issues (ie. strlen() of 2 MB 'string').

10 years agoFix several other xstrndup() instigated off-by-1 errors
Amos Jeffries [Tue, 28 Jul 2015 15:38:55 +0000 (08:38 -0700)] 
Fix several other xstrndup() instigated off-by-1 errors

10 years agoFix off-by-1 in urlpath_regex
Amos Jeffries [Tue, 28 Jul 2015 15:32:29 +0000 (08:32 -0700)] 
Fix off-by-1 in urlpath_regex

10 years agoSourceFormat Enforcement
Source Maintenance [Tue, 28 Jul 2015 12:12:10 +0000 (12:12 +0000)] 
SourceFormat Enforcement

10 years agomerge coverity-fixes: implement LookupTable
Francesco Chemolli [Tue, 28 Jul 2015 08:12:02 +0000 (10:12 +0200)] 
merge coverity-fixes: implement LookupTable

10 years agoMerged from trunk
Francesco Chemolli [Tue, 28 Jul 2015 08:09:21 +0000 (10:09 +0200)] 
Merged from trunk

10 years agoHandle exceptions during squid.conf parse
Amos Jeffries [Tue, 28 Jul 2015 01:58:00 +0000 (18:58 -0700)] 
Handle exceptions during squid.conf parse

Increasingly code used inside squid.conf parsing is capable of throwing
exceptions to signal errors. Catch any unexpected exceptions that reach
the config parse initiator(s) and report as a FATAL event before self
destructing.

 Detected by Coverity Scan. Issue 1231352

10 years agoImplement std::hash<SBuf>
Francesco Chemolli [Mon, 27 Jul 2015 17:41:03 +0000 (19:41 +0200)] 
Implement std::hash<SBuf>

10 years agoRename lookup table in auth/digest/Config.cc
Francesco Chemolli [Mon, 27 Jul 2015 16:31:57 +0000 (18:31 +0200)] 
Rename lookup table in auth/digest/Config.cc

10 years agoMerged from trunk
Francesco Chemolli [Mon, 27 Jul 2015 16:27:11 +0000 (18:27 +0200)] 
Merged from trunk

10 years agoImplement LookupTable unit tests, documentation, copyright blurb
Francesco Chemolli [Mon, 27 Jul 2015 16:25:09 +0000 (18:25 +0200)] 
Implement LookupTable unit tests, documentation, copyright blurb

10 years agodigest_edirectory_auth: refactor berEncodeLoginData for improved readability
Francesco Chemolli [Mon, 27 Jul 2015 15:42:35 +0000 (17:42 +0200)] 
digest_edirectory_auth: refactor berEncodeLoginData for improved readability

10 years agoMigrate to generic LookupTable, document it and clean it up
Francesco Chemolli [Mon, 27 Jul 2015 14:53:51 +0000 (16:53 +0200)] 
Migrate to generic LookupTable, document it and clean it up

10 years agoMerged from trunk
Francesco Chemolli [Mon, 27 Jul 2015 13:40:19 +0000 (15:40 +0200)] 
Merged from trunk

10 years agoReplace RegexList wth std::list<RegexPattern>
Amos Jeffries [Mon, 27 Jul 2015 12:51:43 +0000 (05:51 -0700)] 
Replace RegexList wth std::list<RegexPattern>

10 years agoAdd basic regex config unit tests
Amos Jeffries [Mon, 27 Jul 2015 12:50:53 +0000 (05:50 -0700)] 
Add basic regex config unit tests

10 years agoImplement base/LookupTable as proposed by Amos
Francesco Chemolli [Mon, 27 Jul 2015 09:30:32 +0000 (11:30 +0200)] 
Implement base/LookupTable as proposed by Amos

10 years agoShuffle RegexList.* to base/libbase RegexPattern.*
Amos Jeffries [Mon, 27 Jul 2015 05:21:06 +0000 (22:21 -0700)] 
Shuffle RegexList.* to base/libbase RegexPattern.*

Split the core regex pattern data fields out into a class RegexPattern
for as a container node use in std::list or other constructions.

Leave the custom linked-list operations under the name RegexList. As a
child wrapper class for now so that old API members are still available.

10 years agoImplemented review change requests to edir_ldapext
Francesco Chemolli [Sun, 26 Jul 2015 20:24:16 +0000 (22:24 +0200)] 
Implemented review change requests to edir_ldapext

10 years agoReplace aclDestroyRegexList() with RegexList delete operator
Amos Jeffries [Sun, 26 Jul 2015 18:34:36 +0000 (11:34 -0700)] 
Replace aclDestroyRegexList() with RegexList delete operator

10 years agoFix ICAP transactions that read a lot of data
Alex Rousskov [Sun, 26 Jul 2015 18:26:52 +0000 (12:26 -0600)] 
Fix ICAP transactions that read a lot of data
by ensuring the read buffer has space [unless it is really full].

Trunk r13995 (Parser-NG: Convert the ICAP read buffer to an SBuf)
broke ICAP transactions that read a lot of data because the new
SBuf::consume() method often does not free buffer space, unlike the
old MemBuf::consume(). Affected transactions failed with mayReadMore()
exceptions because their readBuf.spaceSize() was zero while they
needed to read more data.

Any append,parse,consume;append,parse,consume;... user of SBuf cannot
rely on SBuf::spaceSize() to be meaningful because even consuming the
entire SBuf contents may leave spaceSize() at zero! Instead such code
has to use SBuf::length() to keep buffer from growing too big and
SBuf::rawSpace(1) to ensure some space is available for reading when
the buffer is not too big.

10 years agoConvert RegexList to a MEMPROXY_CLASS
Amos Jeffries [Sun, 26 Jul 2015 18:21:19 +0000 (11:21 -0700)] 
Convert RegexList to a MEMPROXY_CLASS

10 years agoWhen SBuf chop()s away everything, always clear the buffer.
Alex Rousskov [Sun, 26 Jul 2015 18:16:34 +0000 (12:16 -0600)] 
When SBuf chop()s away everything, always clear the buffer.

The old code was trying to make the clearance decision without
normalizing parameters first and missed most cases as the result.

In theory, clear()ing SBuf during chop() is just an optimization
that should have no effect on correct code functionality.

10 years agoMerged from trunk
Francesco Chemolli [Sun, 26 Jul 2015 16:17:52 +0000 (18:17 +0200)] 
Merged from trunk

10 years agoSourceLayout: shuffle DiskIO modules into libdiskio library
Amos Jeffries [Sun, 26 Jul 2015 06:45:25 +0000 (23:45 -0700)] 
SourceLayout: shuffle DiskIO modules into libdiskio library

10 years agoCleanup: avoid mentioning compiler directives in configure output
Amos Jeffries [Sun, 26 Jul 2015 00:57:35 +0000 (17:57 -0700)] 
Cleanup: avoid mentioning compiler directives in configure output

In particular -march=native. It confuses some downstream build tools
to encounter the option in its full name form.

10 years agoFix --disable-disk-io behaviour
Amos Jeffries [Sat, 25 Jul 2015 22:09:50 +0000 (15:09 -0700)] 
Fix --disable-disk-io behaviour

auto-enable for DiskIO modules has been done before the AM_CONDITIONAL
are defined. The checks need to test for explicit "yes" values since
disabled modules will have value "" rather than "no" or "auto" like
other components.

10 years agoCleanup: refactor to remove various dead code
Amos Jeffries [Sat, 25 Jul 2015 14:19:36 +0000 (07:19 -0700)] 
Cleanup: refactor to remove various dead code

... detected by or confusing Coverity Scan.

These have been marked False Positive / Intentional earlier.
But long term the best fix is to simply clean out the dead code.

10 years agosmblib: fix buffer over-read
Amos Jeffries [Sat, 25 Jul 2015 12:53:16 +0000 (05:53 -0700)] 
smblib: fix buffer over-read

When parsing SMB LanManager packets with invalid protocol ID and the
default set of Squid supported protocols. It may access memory outside
the buffer storing protocol names.

smblib is only used by already deprecated helpers which are deprecated
due to far more significant NTLM protocol issues. It will also only
result in packets being rejected later with invalid protocol names. So
this is a minor bug rather than a vulnerability.

 Detected by Coverity Scan. Issue 1256165

10 years agoCleanup: remove some obsolete TODOs
Amos Jeffries [Sat, 25 Jul 2015 12:03:27 +0000 (05:03 -0700)] 
Cleanup: remove some obsolete TODOs

10 years agoBug 4251: incorrect instance name for memory segments in /dev/shm
Jose Luis Godoy [Fri, 24 Jul 2015 13:24:01 +0000 (06:24 -0700)] 
Bug 4251: incorrect instance name for memory segments in /dev/shm

10 years agoReworked initializers in HttpDigestFieldAttrs
Francesco Chemolli [Thu, 23 Jul 2015 20:04:46 +0000 (22:04 +0200)] 
Reworked initializers in HttpDigestFieldAttrs

10 years agoImplement std::map-based auth/digest lookup table, part 2 (remove old code)
Francesco Chemolli [Thu, 23 Jul 2015 19:05:42 +0000 (21:05 +0200)] 
Implement std::map-based auth/digest lookup table, part 2 (remove old code)

10 years agoImplement std::map-based auth/digest lookup table, part 1 of 2 (add code)
Francesco Chemolli [Thu, 23 Jul 2015 15:12:49 +0000 (17:12 +0200)] 
Implement std::map-based auth/digest lookup table, part 1 of 2 (add code)

10 years agoRework edir_ldapexxt berEncodeLoginData for improved readability (CID 1294555)
Francesco Chemolli [Thu, 23 Jul 2015 12:20:00 +0000 (14:20 +0200)] 
Rework edir_ldapexxt berEncodeLoginData for improved readability (CID 1294555)

10 years agoMerged from trunk
Francesco Chemolli [Thu, 23 Jul 2015 07:29:41 +0000 (09:29 +0200)] 
Merged from trunk

10 years agoRework Rock::SwapDir::getOptionTree (CID 1312104)
Francesco Chemolli [Wed, 22 Jul 2015 16:43:48 +0000 (18:43 +0200)] 
Rework Rock::SwapDir::getOptionTree (CID 1312104)

10 years agoSourceFormat Enforcement
Source Maintenance [Wed, 22 Jul 2015 00:12:08 +0000 (00:12 +0000)] 
SourceFormat Enforcement

10 years agoMerge Coverity Fixes
Francesco Chemolli [Tue, 21 Jul 2015 19:43:43 +0000 (21:43 +0200)] 
Merge Coverity Fixes

10 years agoMerged from trunk
Francesco Chemolli [Tue, 21 Jul 2015 14:57:09 +0000 (16:57 +0200)] 
Merged from trunk

10 years agoMerged from trunk rev.14169
Amos Jeffries [Tue, 21 Jul 2015 13:56:20 +0000 (06:56 -0700)] 
Merged from trunk rev.14169

10 years agoRevert rev.14165 and rev.14167
Amos Jeffries [Tue, 21 Jul 2015 13:50:24 +0000 (06:50 -0700)] 
Revert rev.14165 and rev.14167

Too much instability added to trunk by these. DiskIO needs a
full refactoring and more testing before its ready to merge.

We will have to live with libIpcIo problems until then.

10 years agoSourceMaintenance updates
Amos Jeffries [Tue, 21 Jul 2015 13:20:11 +0000 (06:20 -0700)] 
SourceMaintenance updates

10 years agoLate-declare variable in ntlm_smb_lm_auth.cc (CID 1256169)
Francesco Chemolli [Tue, 21 Jul 2015 12:53:18 +0000 (14:53 +0200)] 
Late-declare variable in ntlm_smb_lm_auth.cc (CID 1256169)

10 years agoAdded comment on log_file_daemon error reporting
Francesco Chemolli [Tue, 21 Jul 2015 12:42:27 +0000 (14:42 +0200)] 
Added comment on log_file_daemon error reporting

10 years agoRemove direct references to DiskIO/* files from unit tests
Amos Jeffries [Tue, 21 Jul 2015 12:11:06 +0000 (05:11 -0700)] 
Remove direct references to DiskIO/* files from unit tests

10 years agoAdd stub for libdiskio.la
Amos Jeffries [Tue, 21 Jul 2015 12:10:42 +0000 (05:10 -0700)] 
Add stub for libdiskio.la

10 years agoRemove DiskIO/time.cc on file cleaning
Amos Jeffries [Tue, 21 Jul 2015 12:07:46 +0000 (05:07 -0700)] 
Remove DiskIO/time.cc on file cleaning

10 years agoSourceFormat Enforcement
Source Maintenance [Tue, 21 Jul 2015 00:12:11 +0000 (00:12 +0000)] 
SourceFormat Enforcement

10 years agoSourceLayout: build Disk I/O modules as convenience libraries
Amos Jeffries [Mon, 20 Jul 2015 22:37:14 +0000 (15:37 -0700)] 
SourceLayout: build Disk I/O modules as convenience libraries

10 years agoRevert and improve fix for FtpClient.cc
Francesco Chemolli [Mon, 20 Jul 2015 20:39:02 +0000 (22:39 +0200)] 
Revert and improve fix for FtpClient.cc

10 years agoSupport %un (any available user name) format code for external ACLs.
Amos Jeffries [Mon, 20 Jul 2015 18:09:23 +0000 (11:09 -0700)] 
Support %un (any available user name) format code for external ACLs.

The same %un code, with the same meaning is already supported in access.log.
In an external ACL request, it expands to the first available user name
from the following list of information sources:

  - authenticated user name, like %ul or %LOGIN
  - user name supplied by an external ACL to Squid via the "user=..."
    key=value pair, like %ue or %EXT_USER
  - SSL client name, like %us
  - ident user name, like %ui

Based on Amos Jeffries 2011 patch and "arronax28" design:
http://www.squid-cache.org/mail-archive/squid-dev/201112/0080.html
with TODO completion by Measurement Factory

10 years agoAvoid possible leak in Rock::SwapDir::getOptionTree() (CID 740433)
Francesco Chemolli [Mon, 20 Jul 2015 13:48:30 +0000 (15:48 +0200)] 
Avoid possible leak in Rock::SwapDir::getOptionTree() (CID 740433)

10 years agoCheck return code from setsockopt (CID 1231350)
Francesco Chemolli [Mon, 20 Jul 2015 10:19:04 +0000 (12:19 +0200)] 
Check return code from setsockopt (CID 1231350)

10 years agoCheck success of logfile rotations in debug.cc (CID 740321)
Francesco Chemolli [Mon, 20 Jul 2015 09:44:12 +0000 (11:44 +0200)] 
Check success of logfile rotations in debug.cc (CID 740321)

10 years agoSourceLayout: add DiskIO/libdiskio.la convenience library
Amos Jeffries [Sun, 19 Jul 2015 20:09:17 +0000 (13:09 -0700)] 
SourceLayout: add DiskIO/libdiskio.la convenience library

10 years agoSourceFormat Enforcement
Source Maintenance [Sun, 19 Jul 2015 18:12:10 +0000 (18:12 +0000)] 
SourceFormat Enforcement

10 years agoImprove handling of client connections on shutdown
Amos Jeffries [Sun, 19 Jul 2015 13:41:08 +0000 (06:41 -0700)] 
Improve handling of client connections on shutdown

When Squid which are processing a lot of traffic, using persistent
client connections, or dealing with long duration requests are shutdown
they can exit with a lot of connections still open. The
shutdown_lifetime directive exists to allow time for existing
transactions to complete, but this is not always possible and has no
effect on idle connections.

The result is a large dump of aborted FD entries being logged as the TCP
sockets get abruptly reset. Potentially active transactions cache
objects being "corrupted" in the process.

Makes ConnStateData and its children implement Runner API callbacks
to receive signals about Squid shutdown. Which allows their close()
handlers to be run properly and make use of AsyncCalls API. Idle client
connections are closed immediately on the startShutdown() signal, so
their closure CPU cycles happens during the shutdown grace period.

An extra 0-delay event step is added to SignalEngine shutdown sequence
with a new Runner registry hook 'endingShutdown' is added to signal that
the shutdown_lifetime grace period is over for closure of active
transactions. All network FD sockets should be considered unusable for
read()/write() at that point since close handlers may have already been
scheduled by other Runners. AsyncCall's may still be scheduled to
release resources.

Also adds a DeregisterRunner() API action to remove Runners dynamically
from the registered set.

The Squid shutdown sequence is now:

* shutdown signal received:
 - listening sockets closed
 - idle client connections closed

* shutdown grace period ends:
 - remaining client connections closed

* shutdown finishes:
 - main signal and Async loop halted
 - all memory free'd

Server connections which are PINNED or in active use during the
endingShutdown execution will be closed cleanly as a side-effect of the
client closures. Otherwise there is no change (yet) to server connections
or other FD sockets behaviour on shutdown.

10 years agoCleanup: replace urlCanonical() with HttpRequest::effectiveReuqestUri()
Amos Jeffries [Sun, 19 Jul 2015 13:23:01 +0000 (06:23 -0700)] 
Cleanup: replace urlCanonical() with HttpRequest::effectiveReuqestUri()

We have previously been using the term "canonical URL" in Squid to mean
absolute-URI, but not in all cases and may sometimes mean authority-form.
RFC 7230 introduces a new term "Effective Request URI" which directly
matches our desired usage.

* make urlCanonical() global function a method of class HttpRequest
  since it depends on request method for its particular form syntax

* remove the now unnecessary canonical member and HttpRequest::SetHost()

* convert HttpRequest::storeId(), Ftp::UrlWith2f(), and ps_state::url()
  to SBuf usage to avoid performance regressions in their use.

* replace many uses of xstrdup() with xstrndup() for performance where
  the copy cannot be avoided entirely.

* avoid using urlParse() to do a simple URL data-copy in ICAP handling

* update stub_HttpRequest.cc to match full class HttpRequest API

10 years agoTLS: Allow tls-min-version=1.3 configuration
Amos Jeffries [Sun, 19 Jul 2015 08:33:29 +0000 (01:33 -0700)] 
TLS: Allow tls-min-version=1.3 configuration

Bounds limiting was restricting configuration to <1.2 since those are
the currently available TLS versions. But 1.3 is upcoming and may be
used within the lifetime of this Squid version.

 Detected by Coverity Scan. Issue 1311636

10 years agoMerge fixes for some issues reported by Coverity
Francesco Chemolli [Fri, 17 Jul 2015 09:30:47 +0000 (11:30 +0200)] 
Merge fixes for some issues reported by Coverity

10 years agoSourceFormat Enforcement
Source Maintenance [Thu, 16 Jul 2015 18:12:10 +0000 (18:12 +0000)] 
SourceFormat Enforcement