]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
11 years agoPolished to address squid-dev review comments.
Alex Rousskov [Mon, 28 Apr 2014 20:30:43 +0000 (14:30 -0600)] 
Polished to address squid-dev review comments.

11 years agoFixed typo breaking accounting of [forgotten] entries during index build.
Alex Rousskov [Mon, 28 Apr 2014 15:58:39 +0000 (09:58 -0600)] 
Fixed typo breaking accounting of [forgotten] entries during index build.

Forgotten entries would still contribute to the total entry count and, hence,
result in some entries being evicted from cache prematurely.

Added in "Stop wasting 96 RAM bytes per slot" revision (branch r13321).

11 years agoDocument counter-intuitive round-robin cache_dir selection bias; decrease it.
Alex Rousskov [Sat, 26 Apr 2014 17:30:33 +0000 (11:30 -0600)] 
Document counter-intuitive round-robin cache_dir selection bias; decrease it.

Many squid.confs have at least two groups of cache_dir lines. For example,
rare "large" objects go to larger/slower HDDs while popular "small" objects go
to smaller/fast SSDs:

    # HDDs
    cache_dir rock /hdd1 ... min-size=large
    cache_dir rock /hdd2 ... min-size=large
    cache_dir rock /hdd3 ... min-size=large
    # SSDs
    cache_dir rock /ssd1 ... max-size=large-1
    cache_dir rock /ssd2 ... max-size=large-1
    cache_dir rock /ssd3 ... max-size=large-1
    # rock store does not support least-load yet
    store_dir_select_algorithm round-robin

Since round-robin selects the first suitable disk during a sequential scan,
the probability of /hdd1 (/ssd1) selection is higher than other HDDs (SSDs).
Consider a large object that needs an HDD: /hdd1 is selected whenever scan
starts at /ssd1, /ssd2, /ssd3, and /hdd1 while /hdd2 is selected only when the
scan starts at /hdd2 itself! Documentation now warns against the above
cache_dir configuration approach and suggests to interleave cache_dirs:

    cache_dir rock /hdd1 ... min-size=large
    cache_dir rock /ssd1 ... max-size=large-1
    cache_dir rock /hdd2 ... min-size=large
    cache_dir rock /ssd2 ... max-size=large-1
    cache_dir rock /hdd3 ... min-size=large
    cache_dir rock /ssd3 ... max-size=large-1
    store_dir_select_algorithm round-robin

Squid's historic implementation of round-robin made its natural bias even
worse because it made the starting point of the sequential scan to be the last
selected dir. In the first configuration example above, it boosted the
probability that the scan will start at one of the SSDs because smaller
objects are more popular and, hence, their dirs are selected more often.  With
the starting point usually at an SSD, even more _large_ objects were sent to
/hdd1 compared to other HDDs! The code change avoids this artificial boost
(but the cache_dir lines should still be interleaved to avoid the natural
round-robin bias discussed earlier).

11 years agoFix malloc corruption from use-after-free in peer_select.cc
Alex Rousskov [Thu, 24 Apr 2014 17:44:23 +0000 (11:44 -0600)] 
Fix malloc corruption from use-after-free in peer_select.cc

same as trunk r13340

11 years agoStop wasting 96 RAM bytes per slot for high-offset slots in large shared caches
Alex Rousskov [Mon, 21 Apr 2014 18:09:06 +0000 (12:09 -0600)] 
Stop wasting 96 RAM bytes per slot for high-offset slots in large shared caches
with more than 16777216 slots.

Ipc::StoreMap was using the same structure for all db slots. However, slots at
offsets exceeding SwapFilenMax (16777215) could not contain store entry
anchors and the anchor part of the structure was wasting RAM for those slots.
This change splits a single array of StoreMapSlots into two arrays, one
storing StoreMapAnchors and one storing StoreMapSlices. The anchors array is
shorter for caches with more than 16777216 slots.

For example, a StoreMap for a 1TB shared cache with default 16KB slot sizes
(67108864 slots) occupied about 6.5GB of RAM. After this change, the same
information is stored in about 2.0GB because unused anchors are not stored.

32-bit environments were wasting 72 (instead of 96) bytes per high-offset slot.

Also simplified Ipc::StoreMap API by removing its StoreMapWithExtras part.
The added complexity caused bugs and was not worth saving a few extra lines of
callers code. With the StoreMap storage array split in two, the extras may
belong to each part (although the current code only adds extras to slices),
further complicating the WithExtras part of the StoreMap API. These extras
are now stored in dedicated shared memory segments (*_ex.shm).

Added Ipc::Mem::Segment::Name() function to standardize segment name
formation.  TODO: Attempt to convert shm_new/old API to use SBuf instead of
char* to simplify callers, most of which have to form Segment IDs by
concatenating strings.

11 years agoAllow HITs on entries backed by a shared memory cache only.
Alex Rousskov [Sat, 19 Apr 2014 23:05:51 +0000 (17:05 -0600)] 
Allow HITs on entries backed by a shared memory cache only.

A typo in r12501.1.59 "Do not become a store_client for entries that are not
backed by Store" prevented such entries from being used for HITs and possibly
even purged them from the memory cache.

11 years agoRestored Squid ability to cache (in memory) when no disk caches are configured
Alex Rousskov [Fri, 18 Apr 2014 16:57:01 +0000 (10:57 -0600)] 
Restored Squid ability to cache (in memory) when no disk caches are configured
which was lost during r12662 "Bug 3686: cache_dir max-size default fails"

The bug was hidden until the memory cache code started calling
StoreEntry::checkCachable() in branch r13315, exposing the entry size check to
a broken limit.

r12662 converted store_maxobjsize from a sometimes present disk-only limit to
an always set Squid-global limit. However, store_maxobjsize value was only
calculated when parsing cache_dirs. A config without cache_dirs would leave
store_maxobjsize at -1, triggering "StoreEntry::checkCachable: NO: too big"
prohibition for all responses.

This change moves store_maxobjsize calculation from parser to storeConfigure()
where some other Store globals are computed after squid.conf parsing.

Also honored memory cache size limit (just in case cache_mem is smaller than
maximum_object_size_in_memory) and removed leftover checks for
store_maxobjsize being set (it should always be set, at least to zero).

11 years agoSignificantly reduced Large Rock (and slightly shared memory) RAM requirements
Alex Rousskov [Thu, 10 Apr 2014 04:56:25 +0000 (22:56 -0600)] 
Significantly reduced Large Rock (and slightly shared memory) RAM requirements
by not allocating 40 (and 12) bytes of unused RAM per cache slot.

Rock: Stale code inherited from the Small Rock implementation allocated 40
bytes of unused memory per rock db slot (2.5GB of RAM for a 1TB disk with 16KB
db slots). The current (Large Rock) code stores the same kind of information
(and more) in a different location (Ipc::StoreMap).

Shared memory: Similarly, the Large Rock-based shared memory cache allocated
12 bytes of unused memory per shared memory cache slot (3.8MB of RAM for a
10GB shared RAM cache with 32KB slots).

11 years agoLifted 16777216 slot limit from rock cache_dirs and shared memory caches.
Alex Rousskov [Sun, 6 Apr 2014 21:02:18 +0000 (15:02 -0600)] 
Lifted 16777216 slot limit from rock cache_dirs and shared memory caches.
Also fixed rock disk space waste warning.

Rock store and shared memory cache code used entry and slot limit as if
the two were the same. In large caches, the number of entry slots may exceed
the number of entries supported by Squid (16777216 entries per store). This
is especially likely with large caches storing large entries (many slots
per entry with maximum number of entries) or large caches using small slot
sizes.

AFAICT, the bug led to the "tail" of cache storage being unused and cache
entries being purged even though there was still space to store them. Also,
Squid was allocating smaller shared memory tables (and temporary cache index
build tables) than actually needed for the configured cache sizes.

Note that this change does not remove the per-store 16777216 entry limit.

The old [small] rock warning about wasted disk space assumed that a cache
entry occupies exactly one slot. The updated warnings do not.

Also fixed and simplified db scanning condition during cache index build.

11 years agoReport IpcIo file name with errors and warnings
Alex Rousskov [Fri, 4 Apr 2014 16:10:40 +0000 (10:10 -0600)] 
Report IpcIo file name with errors and warnings
to inform admin which cache_dir needs troubleshooting or tuning.

Some level-0/1 messages did not mention disker ID or file name at all while
others relied on disker process ID which is too low-level information from most
admins point of view.

Also improved error and warning messages consistency.

11 years agoAvoid "FATAL: Squid has attempted to read data from memory that is not present"
Alex Rousskov [Wed, 19 Mar 2014 04:04:52 +0000 (22:04 -0600)] 
Avoid "FATAL: Squid has attempted to read data from memory that is not present"
crashes. Improve related code.

Shared memory caching code was not checking whether the response is generally
cachable and, hence, tried to store responses that Squid already refused to
cache (e.g., release-requested entries). The shared memory cache should also
check that the response is contiguous because the disk store may not check
that (e.g., when disk caching id disabled).

The problem was exacerbated by the broken entry dump code accompanying the
FATAL message. The Splay tree iterator is evidently not iterating a portion of
the tree. I added a visitor pattern code to work around that, but did not try
to fix the Splay iterator iterator itself because, in part, the whole iterator
design felt inappropriate (storing and flattening the tree before iterating
it?) for its intended purpose. I could not check quickly enough where the
broken iterator is used besides mem_hdr::debugDump() so more bugs like this
are possible.

Optimized StoreEntry::checkCachable() a little and removed wrong TODO comment:
Disk-only mayStartSwapOut() should not accumulate "general" cachability checks
which are used by RAM caches as well.

Added more mem_hdr debugging and polished method descriptions.

Fixed NullStoreEntry::mayStartSwapout() spelling/case. It should override
StoreEntry::mayStartSwapOut().

11 years agoMake sure Squid dumps core and not just promises one
Alex Rousskov [Tue, 18 Mar 2014 22:49:20 +0000 (16:49 -0600)] 
Make sure Squid dumps core and not just promises one
when memory management goes wrong.

11 years agoUndo trunk r13266: "vector-refactor branch: align Vector API with std::vector"
Alex Rousskov [Tue, 18 Mar 2014 00:51:48 +0000 (18:51 -0600)] 
Undo trunk r13266: "vector-refactor branch: align Vector API with std::vector"
to avoid stability issues related to std::vector migration.

11 years agoUndo trunk r13269: "Vector refactor: move almost all clients to std::vector"
Alex Rousskov [Mon, 17 Mar 2014 23:44:19 +0000 (17:44 -0600)] 
Undo trunk r13269: "Vector refactor: move almost all clients to std::vector"
to avoid stability issues related to std::vector migration.

11 years agoUndo trunk r13270: "Refactor Vector and Stack to STL counterparts"
Alex Rousskov [Mon, 17 Mar 2014 21:03:04 +0000 (15:03 -0600)] 
Undo trunk r13270: "Refactor Vector and Stack to STL counterparts"
to avoid stability issues related to std::vector migration.

11 years agoAuthor: Nikolai Gorchilov <niki@x3me.net>
Nikolai Gorchilov [Thu, 13 Mar 2014 21:11:47 +0000 (15:11 -0600)] 
Author: Nikolai Gorchilov <niki@x3me.net>
Use request URI instead of StoreID when forwarding requests to cache peers.

TODO: There are more bugs like that, including using Store IDs in ICP requests.

11 years agourl_rewrite_extras and store_id_extras patch fixes
Christos Tsantilas [Thu, 13 Mar 2014 10:56:38 +0000 (12:56 +0200)] 
url_rewrite_extras and store_id_extras patch fixes

Fixes to patch "Add url_rewrite_extras and store_id_extras for redirector and store_id helpers",r13308:
  - Fix cf_gen.cc:gen_conf(..) function to not escape quotes before write to
    conf file
  - The Format::Format name is used to inform the user about parsing problems.
    Fix the names of related objects for the new redirecor_extras and
    store_id_extras directives.
  - cf.data.pre: The NAME tag take as argument only the name of directive. Fix
    the new redirecor_extras and store_id_extras related tags.

11 years agoAdd url_rewrite_extras and store_id_extras for redirector and store_id helpers
Christos Tsantilas [Wed, 12 Mar 2014 16:46:27 +0000 (18:46 +0200)] 
Add url_rewrite_extras and store_id_extras for redirector and store_id helpers

The url_rewrite_extras/store_id_extras is a "quoted string" with logformat
%macro support. It is used to modify the request line for redirector and
storeId helpers.

The url rewrite and store_id helpers request format now is:
       url [<SP> extras]
and the default value for extras is:
  "%>a/%>A %un %>rm myip=%la myport=%lp"

Example usage:
   url_rewrite_extras "Note1=%{Note1}note Note2=%{Note2}note"

This is a Measurement Factory project.

11 years agoPrep for 3.3.12 and 3.4.4
Amos Jeffries [Sun, 9 Mar 2014 03:06:51 +0000 (20:06 -0700)] 
Prep for 3.3.12 and 3.4.4

11 years agoAvoid assertions on Range requests that trigger Squid-generated errors.
Alex Rousskov [Sat, 8 Mar 2014 17:28:23 +0000 (10:28 -0700)] 
Avoid assertions on Range requests that trigger Squid-generated errors.

Added HttpRequest::ignoreRange() to encapsulate range ignoring logic.
Currently the new method only contains the code common among all callers. More
work is needed to check whether further caller homogenization is possible.

Documented that ClientSocketContext::getNextRangeOffset() may sometimes be
called before it is ready to do its job.

11 years agoProtect MemBlob::append() against raw-space writes
Amos Jeffries [Fri, 7 Mar 2014 11:18:03 +0000 (04:18 -0700)] 
Protect MemBlob::append() against raw-space writes

There is no guarantee that the 'unused' area of MemBlob is actually
unused. For example if a read buffer was being filled into the
rawSpace() of a SBuf or MemBlob it will overlap with this empty area
until a read call updates the related size state in MemBlob/SBuf.

For these cases we must use memmove() which guarantees no buffer
corruption will take place on memory overlaps.

11 years agoCopyright: Remove explicit claims on src/ by Treehouse Networks Ltd.
Amos Jeffries [Thu, 6 Mar 2014 05:41:17 +0000 (18:41 +1300)] 
Copyright: Remove explicit claims on src/ by Treehouse Networks Ltd.

Amos Jeffries is listed as author in CONTRIBUTORS and Treehouse Networks
Ltd. listed in SPONSORS and commit messages.

11 years agoCopyright: Relicense helpers by Treehouse Networks Ltd.
Amos Jeffries [Thu, 6 Mar 2014 03:55:41 +0000 (20:55 -0700)] 
Copyright: Relicense helpers by Treehouse Networks Ltd.

Update the license on helper code designed and authored by myself using
the BSD 2-clause license. This makes the example helper code and license
more legally acceptible for use as a basis of proprietary helpers while
remaining compatible with GPL for distribution with Squid.

11 years agoLanguages: Georgian dialect
Amos Jeffries [Wed, 5 Mar 2014 22:34:18 +0000 (11:34 +1300)] 
Languages: Georgian dialect

11 years agoLanguages: Georgian
Amos Jeffries [Wed, 5 Mar 2014 22:30:03 +0000 (11:30 +1300)] 
Languages: Georgian

11 years agoTranslation: update POT content
Amos Jeffries [Wed, 5 Mar 2014 22:25:04 +0000 (11:25 +1300)] 
Translation: update POT content

11 years agoBetter fix for CMSG definitions
Amos Jeffries [Wed, 5 Mar 2014 12:08:54 +0000 (01:08 +1300)] 
Better fix for CMSG definitions

It turns out autoconf versions are not consistent with $ symbol escaping
which can cause incorrect definitions. Revert to AC_CHECK_TYPE instead.
Its a bit more verbose in configure.ac but works more often than not.

11 years agoPortability: define CMSG related structures individually
Amos Jeffries [Wed, 5 Mar 2014 06:32:34 +0000 (19:32 +1300)] 
Portability: define CMSG related structures individually

Some OS provide the CMSG related definitions and others only partially
define them. Sometimes (Windows particularly) this varies between build
environments.

Checking for each symbol separately and providing only those needed
avoids problems we have been having with missing or redefined symbols
on Windows and elsewhere.

11 years agoAdd debug messages indicating type/reason for HITs
Amos Jeffries [Tue, 4 Mar 2014 10:40:36 +0000 (23:40 +1300)] 
Add debug messages indicating type/reason for HITs

11 years agoFix helper ID number assignment
Amos Jeffries [Tue, 4 Mar 2014 10:33:08 +0000 (23:33 +1300)] 
Fix helper ID number assignment

Since helpers are now dynamically started the old method of allocating
an ID number based on the current start sequence can result in many
helpers being assigned overlapping ID numbers.

Use InstanceID template instead to assure a unique incremental ID is
assigned to each helper no matter when it is started.

11 years agoFix syntax error in pinger
Francesco Chemolli [Mon, 24 Feb 2014 12:20:29 +0000 (13:20 +0100)] 
Fix syntax error in pinger

11 years agoMigrated RegisteredRunners to a multi-action interface.
Alex Rousskov [Fri, 21 Feb 2014 16:14:05 +0000 (09:14 -0700)] 
Migrated RegisteredRunners to a multi-action interface.

Old generic two-action RegisteredRunners were good for handling paired
create/destroy events, but not all main.cc events fit that model well. In
fact, even the old runners implemented the destruction action for one event
only (rrAfterConfig); all other runners implemented a single action.

The adjusted API better supports runners that are interested in any number
of the supported events. It also allows a single runner object to handle
multiple events, which simplifies current code and may help with better
[re]configuration handling in the future.

Added startShutdown() and finishShutdown() events. The former will be needed
for authentication module shutdown and more polished shutdown initiation code
in general (patch pending). The latter is needed for final cleanup code that
previously ran as the destruction action for rrAfterConfig. finishShutdown()
also destroys all runners.

Note that the master process in SMP mode does not run startShutdown because
that process lacks the main loop and startShutdown() promises at least one
main loop iteration (to help with clean connections closures, for example).

Added syncConfig() event that will be needed for the standby pool
implementation (patch pending) and future code that reacts to Squid
configuration changes caused by reconfiguration.

"after config" event is now called "use config" to better match verb+noun or
action+object naming scheme.

11 years agoFixed stalled concurrent rock store reads by insuring their ID uniqueness.
Alex Rousskov [Fri, 21 Feb 2014 15:45:01 +0000 (08:45 -0700)] 
Fixed stalled concurrent rock store reads by insuring their ID uniqueness.

Added a check to prevent similar bugs from occurring in the future.

11 years agoCleanup: un-wrap C++ header includes
Amos Jeffries [Fri, 21 Feb 2014 10:46:19 +0000 (03:46 -0700)] 
Cleanup: un-wrap C++ header includes

Coding guideline is now that standard C++ headers are not to be
wrapped in HAVE_ macros.

* Remove HAVE_ macros for currently wrapped C++ headers.
  Includes removing autoconf checks.

* Replace C includes with C++ includes where possible

Also, <cstdio> / <stdio.h> has issues on 64-bit systems and a
portable fixed version is provided by libcompat via squid.h
It should not be included anywhere in the Squid sources.

11 years agoLanguages: updated Serbian aliases
Marko Cupac [Fri, 21 Feb 2014 10:10:21 +0000 (03:10 -0700)] 
Languages: updated Serbian aliases

11 years agoBug 3186, Bug 3628: Digest authentication always sending stale=false for nonce
Henrik Nordstrom [Fri, 21 Feb 2014 02:19:52 +0000 (19:19 -0700)] 
Bug 3186, Bug 3628: Digest authentication always sending stale=false for nonce

11 years agoFix compile issues in rev.13288
Amos Jeffries [Thu, 20 Feb 2014 23:33:29 +0000 (12:33 +1300)] 
Fix compile issues in rev.13288

11 years agosquidclient: --ping mode module support
Amos Jeffries [Thu, 20 Feb 2014 13:03:07 +0000 (06:03 -0700)] 
squidclient: --ping mode module support

  Module support:

Update squidclient support modules with different logics
and configuration option sets as a basis for multiple
protocol support.

A mechanism is added to allow each module to have its own
command line option set. Any option unknown to the current
module handler drops back to the main loop for processing.

  --ping mode module:

Break the existing code "ping mode" operations and command
line processing out from the main squidclient.cc into Ping.*

Ping-specific short command line options are now only parsed
after a mode flag (--ping) is presented. This frees up the
-g and -I options for use by other non-ping modules in future.

Also, shuffle squidclient code into its own directory
tools/squidclient/ to keep the tool code files clearly
identifiable now that they are multiplying.

11 years agoBug 3628: Digest auth sending stale=false on nonce mismatch
Henrik Nordstrom [Thu, 20 Feb 2014 01:50:39 +0000 (18:50 -0700)] 
Bug 3628: Digest auth sending stale=false on nonce mismatch

11 years agodynamic_cert_mem_cache_size option related fixes part2: "make check" fails
Christos Tsantilas [Wed, 19 Feb 2014 18:48:16 +0000 (20:48 +0200)] 
dynamic_cert_mem_cache_size option related fixes part2: "make check" fails

11 years agodynamic_cert_mem_cache_size option related fixes
Christos Tsantilas [Wed, 19 Feb 2014 17:53:27 +0000 (19:53 +0200)] 
dynamic_cert_mem_cache_size option related fixes

This patch fixes the following problems:

1) The dynamic_cert_mem_cache_size does not change on reconfigure

2) When dynamic_cert_mem_cache_size of http_port set to 0 then:

   a) The dynamic certs cache is grow unlimited.
      This patch just disables certificates caching when this option set to 0.

   b) Huge amount of memory appeared as free cache memory in  "Cached ssl
      certificates statistic" page of cache manager.
      This problem caused because of a signed to unsigned int conversion.

This is a Measurement Factory project

11 years agoFix uses of std::remove to actually resize the data structures which were cleaned-up.
Francesco Chemolli [Wed, 19 Feb 2014 17:01:30 +0000 (18:01 +0100)] 
Fix uses of std::remove to actually resize the data structures which were cleaned-up.

11 years agoFix pthread library detection on FreeBSD 10
Amos Jeffries [Tue, 18 Feb 2014 13:57:16 +0000 (06:57 -0700)] 
Fix pthread library detection on FreeBSD 10

We should not be using "cut -b1" anywhere to determine OS version
number. It drops digits out of the major version number.

11 years agoFix umask default on crash report generated email
Amos Jeffries [Tue, 18 Feb 2014 11:39:58 +0000 (04:39 -0700)] 
Fix umask default on crash report generated email

11 years agoBug 4029: intercepted HTTPS requests bypass caching checks
Rajiv Desai [Mon, 17 Feb 2014 14:05:24 +0000 (06:05 -0800)] 
Bug 4029: intercepted HTTPS requests bypass caching checks

11 years agoFix shadowed variable in rev.13279
Amos Jeffries [Sun, 16 Feb 2014 09:50:29 +0000 (22:50 +1300)] 
Fix shadowed variable in rev.13279

11 years agosquidclient: support long options on command line
Amos Jeffries [Sun, 16 Feb 2014 06:14:16 +0000 (23:14 -0700)] 
squidclient: support long options on command line

11 years agosquidclient: polish and documentation
Amos Jeffries [Sun, 16 Feb 2014 05:55:24 +0000 (22:55 -0700)] 
squidclient: polish and documentation

11 years agosquidclient: support verbosity levels
Amos Jeffries [Sun, 16 Feb 2014 05:15:45 +0000 (22:15 -0700)] 
squidclient: support verbosity levels

This makes the -v option repeatable. By default no debug is displayed.
Each time -v is repeated the level of debug message verbosity is raised.

Three levels of verbosity are currently defined:
 0 - no output except ERROR messages.
 1 - display HTTP request sent
 2 - display actions taken connecting to server

11 years agosquidclient: polish and update help display
Amos Jeffries [Sun, 16 Feb 2014 03:22:24 +0000 (20:22 -0700)] 
squidclient: polish and update help display

11 years agoFix memory leak regression in SNMP from rev.13274
Amos Jeffries [Thu, 13 Feb 2014 22:22:35 +0000 (11:22 +1300)] 
Fix memory leak regression in SNMP from rev.13274

Variable "name" going out of scope leaks the storage it points to if any
of the parse was done by incomplete.

 Detected by Coverity Scan. Issue 1174204.

11 years agoBug 4001: remove use of strsep()
Amos Jeffries [Thu, 13 Feb 2014 07:02:35 +0000 (20:02 +1300)] 
Bug 4001: remove use of strsep()

The strsep() function is not defined by POSIX. Additionally
auto-tools has been having some obscure issues detecting
or linking the provided implementation into libcompat on
Windows and Solaris respectively. Which are the two known
OS requiring it.

Investigation of its use in Squid revealed that it can be
replaced with strcspan() which is both portable and more
efficient since it also removes the need for several
strdup()/free() operations used to protect Squid from
strsep() memory fiddling.

11 years agoBug 4026: SSL and adaptation_access does not handle aborted connections
Nathan Hoad [Thu, 13 Feb 2014 06:09:26 +0000 (19:09 +1300)] 
Bug 4026: SSL and adaptation_access does not handle aborted connections

11 years agoRevert rev.13271
Amos Jeffries [Thu, 13 Feb 2014 05:41:14 +0000 (18:41 +1300)] 
Revert rev.13271

11 years agoBug 4026: SSL and adaptation_access does not handle aborted connections
Nathan Hoad [Thu, 13 Feb 2014 05:29:15 +0000 (18:29 +1300)] 
Bug 4026: SSL and adaptation_access does not handle aborted connections

11 years agoRefactor Vector and Stack to STL counterparts
Francesco Chemolli [Wed, 12 Feb 2014 10:43:26 +0000 (11:43 +0100)] 
Refactor Vector and Stack to STL counterparts

11 years agoStreamline storeLateRelease
Francesco Chemolli [Wed, 12 Feb 2014 09:19:06 +0000 (10:19 +0100)] 
Streamline storeLateRelease

11 years agoFix crash bug in HttpHeader::clean()
Francesco Chemolli [Wed, 12 Feb 2014 08:51:26 +0000 (09:51 +0100)] 
Fix crash bug in HttpHeader::clean()

11 years agoRemove Vector, Stack and related unit tests
Francesco Chemolli [Tue, 11 Feb 2014 13:14:09 +0000 (14:14 +0100)] 
Remove Vector, Stack and related unit tests

11 years agoReworked all clients of Stack to std::stack
Francesco Chemolli [Tue, 11 Feb 2014 12:05:47 +0000 (13:05 +0100)] 
Reworked all clients of Stack to std::stack

11 years agoReworked cbdata to use std::vector to be able to have a random access iterator
Francesco Chemolli [Tue, 11 Feb 2014 12:02:07 +0000 (13:02 +0100)] 
Reworked cbdata to use std::vector to be able to have a random access iterator

11 years agoMerged from trunk
Francesco Chemolli [Tue, 11 Feb 2014 11:45:10 +0000 (12:45 +0100)] 
Merged from trunk

11 years agoVector refactor: move almost all clients to std::vector from Vector
Francesco Chemolli [Tue, 11 Feb 2014 11:35:20 +0000 (12:35 +0100)] 
Vector refactor: move almost all clients to std::vector from Vector

11 years agoMerged from trunk
Francesco Chemolli [Tue, 11 Feb 2014 11:32:45 +0000 (12:32 +0100)] 
Merged from trunk

11 years agoFixed some formatting
Francesco Chemolli [Tue, 11 Feb 2014 11:30:51 +0000 (12:30 +0100)] 
Fixed some formatting

11 years agoRefactor Splay and MemPoolMalloc to use std::stack
Francesco Chemolli [Tue, 11 Feb 2014 11:22:39 +0000 (12:22 +0100)] 
Refactor Splay and MemPoolMalloc to use std::stack

11 years agoAdapt some callers to std:: API
Francesco Chemolli [Tue, 11 Feb 2014 09:57:24 +0000 (10:57 +0100)] 
Adapt some callers to std:: API

11 years agoCleanup: remove garbage prefixes from Digest auth debugs
Amos Jeffries [Tue, 11 Feb 2014 09:12:28 +0000 (02:12 -0700)] 
Cleanup: remove garbage prefixes from Digest auth debugs

11 years agoAdded missing includes
Francesco Chemolli [Mon, 10 Feb 2014 22:39:56 +0000 (23:39 +0100)] 
Added missing includes

11 years agoCleanup
Francesco Chemolli [Mon, 10 Feb 2014 17:52:49 +0000 (18:52 +0100)] 
Cleanup

11 years agoRefactor all users of Vector to std::vector except for Stack
Francesco Chemolli [Mon, 10 Feb 2014 17:18:48 +0000 (18:18 +0100)] 
Refactor all users of Vector to std::vector except for Stack

11 years agoMore Vector to std::vector refactoring
Francesco Chemolli [Mon, 10 Feb 2014 16:39:10 +0000 (17:39 +0100)] 
More Vector to std::vector refactoring

11 years agoRefactor HttpHeader::entries
Francesco Chemolli [Mon, 10 Feb 2014 15:07:49 +0000 (16:07 +0100)] 
Refactor HttpHeader::entries

11 years agoGet rid of all users of Vector::iterator::incrementable
Francesco Chemolli [Mon, 10 Feb 2014 13:55:54 +0000 (14:55 +0100)] 
Get rid of all users of Vector::iterator::incrementable

11 years agoMigrate some users of Vector to std::vector
Francesco Chemolli [Mon, 10 Feb 2014 12:58:49 +0000 (13:58 +0100)] 
Migrate some users of Vector to std::vector

11 years agoMerged from trunk
Francesco Chemolli [Mon, 10 Feb 2014 12:38:41 +0000 (13:38 +0100)] 
Merged from trunk

11 years agoFix argument name conflict in Auth::Config::findUserInCache
Francesco Chemolli [Mon, 10 Feb 2014 12:37:47 +0000 (13:37 +0100)] 
Fix argument name conflict in Auth::Config::findUserInCache

11 years agoMerge vector-refactor branch: align Vector API with std::vector
Francesco Chemolli [Mon, 10 Feb 2014 12:15:40 +0000 (13:15 +0100)] 
Merge vector-refactor branch: align Vector API with std::vector

11 years agoMerged from trunk
Francesco Chemolli [Mon, 10 Feb 2014 12:14:44 +0000 (13:14 +0100)] 
Merged from trunk

11 years agoBug 3969: user credentials cache lookup for Digest authentication broken
Frederic Bourgeois [Mon, 10 Feb 2014 11:08:58 +0000 (04:08 -0700)] 
Bug 3969: user credentials cache lookup for Digest authentication broken

Changes to the username credentials cache were made in Basic auth but
the matching changes were not duplicated to Digest auth. Since the
lookup is identical move it to generic Auth::Config.

Also fixes assertion auth_digest.cc:759:
    "(nonce->user == NULL) || (nonce->user == user)"

11 years agoMerged from trunk
Francesco Chemolli [Mon, 10 Feb 2014 09:59:19 +0000 (10:59 +0100)] 
Merged from trunk

11 years agoMake ESICustomParser::parse c++98-compatible
Francesco Chemolli [Mon, 10 Feb 2014 09:19:56 +0000 (10:19 +0100)] 
Make ESICustomParser::parse c++98-compatible

11 years agoFix cstdio compile errors
Amos Jeffries [Sun, 9 Feb 2014 08:55:01 +0000 (01:55 -0700)] 
Fix cstdio compile errors

11 years agoSource Maintenance - manual run
Amos Jeffries [Sat, 8 Feb 2014 13:36:42 +0000 (06:36 -0700)] 
Source Maintenance - manual run

11 years agoMove compat/unsafe.h protections from libcompat to source maintenance
Amos Jeffries [Sat, 8 Feb 2014 12:33:31 +0000 (05:33 -0700)] 
Move compat/unsafe.h protections from libcompat to source maintenance

It is sufficient to run a code scan from source-maintenance.sh for the
unsafe functions being used in Squid-specific code instead of
hard-coding compiler breakage on users.
This also "fixes" reporting of errors when cstdio pulls in use of the
unsafe functions by stdlib.

11 years agoVarious fixes to configure for FreeBSD 10
Dennis Glatting [Sat, 8 Feb 2014 08:53:47 +0000 (01:53 -0700)] 
Various fixes to configure for FreeBSD 10

* Detect cstdio file presence for libcompat

* Fix shell syntax in Heimdal Kerberos library detection

11 years agoUse Vector::at() instead of [] errorInitialize()
Francesco Chemolli [Fri, 7 Feb 2014 16:14:42 +0000 (17:14 +0100)] 
Use Vector::at() instead of [] errorInitialize()

11 years agoMerged from trunk
Francesco Chemolli [Fri, 7 Feb 2014 15:38:35 +0000 (16:38 +0100)] 
Merged from trunk

11 years agoHave Vector::at rely on operator[] to do the low-level access
Francesco Chemolli [Fri, 7 Feb 2014 15:37:11 +0000 (16:37 +0100)] 
Have Vector::at rely on operator[] to do the low-level access

11 years agoSourceLayout: shuffle URLScheme to AnyP::UriScheme
Amos Jeffries [Fri, 7 Feb 2014 13:45:20 +0000 (06:45 -0700)] 
SourceLayout: shuffle URLScheme to AnyP::UriScheme

This class holds a generic protocol agnostic Scheme representation.

* rename const_str() member to c_str() since it produces a const C-string
 (char*) representation.

* Remove some unecessary dependencies.

* Cleanup the coding style to match guidelines.

11 years agoVector::pop_back returns void now; don't save the old value
Francesco Chemolli [Thu, 6 Feb 2014 14:14:36 +0000 (15:14 +0100)] 
Vector::pop_back returns void now; don't save the old value

11 years agoMerged from trunk
Francesco Chemolli [Thu, 6 Feb 2014 13:05:41 +0000 (14:05 +0100)] 
Merged from trunk

11 years agoRegression Bug 3769: client_netmask not evaluated since Comm redesign
Amos Jeffries [Thu, 6 Feb 2014 12:16:08 +0000 (05:16 -0700)] 
Regression Bug 3769: client_netmask not evaluated since Comm redesign

11 years agoFix r13257 commit
Francesco Chemolli [Thu, 6 Feb 2014 09:30:48 +0000 (10:30 +0100)] 
Fix r13257 commit

11 years agoFix keepalive handling for non-ranged requests.
Alex Rousskov [Wed, 5 Feb 2014 18:04:47 +0000 (19:04 +0100)] 
Fix keepalive handling for non-ranged requests.

Internal keepalive flag was ignored by a mismatched interface between ClientSocketContext::socketState
and writeComplete in the case of non-ranged requests.

11 years agoChanged c-style cast to const_cast in esi/CustomParser.cc
Francesco Chemolli [Tue, 4 Feb 2014 19:55:16 +0000 (20:55 +0100)] 
Changed c-style cast to const_cast in esi/CustomParser.cc

11 years agoRemoved useless include in errorpage.cc
Francesco Chemolli [Tue, 4 Feb 2014 19:51:44 +0000 (20:51 +0100)] 
Removed useless include in errorpage.cc

11 years agoReverted broken change in HttpRequest::multipartRangeRequest
Francesco Chemolli [Tue, 4 Feb 2014 19:50:02 +0000 (20:50 +0100)] 
Reverted broken change in HttpRequest::multipartRangeRequest

11 years agoRemove Vector::operator +=. Removed some useless comments
Francesco Chemolli [Tue, 4 Feb 2014 19:47:14 +0000 (20:47 +0100)] 
Remove Vector::operator +=. Removed some useless comments

11 years agoMove some looping checks from size() to !empty()
Francesco Chemolli [Tue, 4 Feb 2014 16:54:49 +0000 (17:54 +0100)] 
Move some looping checks from size() to !empty()