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
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.
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.
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.
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.
Amos Jeffries [Sun, 2 Feb 2014 01:24:53 +0000 (18:24 -0700)]
Fix peerSelectDnsResults() IP address cycling
The local ip variable is the index of the IP address to be used.
Loop counter n is only used to prevent cycling indefinitely and should
not be used to access the array indexes.
Patch written by 'dim [1]' contributor to FreeBSD and imported to Squid
under FreeBSD license. see
http://svnweb.freebsd.org/ports/head/www/squid33/files/patch-include__Array.h
Amos Jeffries [Fri, 24 Jan 2014 01:57:15 +0000 (18:57 -0700)]
Enable -n command line option for non-Windows Squid builds
This command line option is used on Windows to name the service instance
of Squid being run and/or managed. At this point it still only has
useful effect on Windows, but can now be used by components on other
systems as well.
Show the running instance service name in cacehmgr and -v output.
Also remove _WIN_SQUID_DEFAULT_SERVICE_NAME macro which duplicated the
APP_SHORTNAME macro. This changes the Windows service name from Squid to
squid (lower case) on future Squid-3 for Windows.
When running Squid in SMP mode, the 'client_list' command cannot be used as the
coordinator doesn't call clientdbInit(), and thus doesn't have the client_list
action registered.
This patch uses RegisteredRunner to initialize clientdb and register the
'client_list' command
Doug Dixon [Mon, 20 Jan 2014 10:43:03 +0000 (23:43 +1300)]
Bug 1202 part 1: documentation and debugs for refresh_pattern algorithms
This contains only the code documentation and debugs changes as relevant
to the current code. Some which are only relevant to the new code from
that bug patch have been omitted.
It omits all logic changes and function renaming changes.
Amos Jeffries [Mon, 20 Jan 2014 01:20:40 +0000 (14:20 +1300)]
Set error page Content-Type character set to UTF-8
This fixes issues with some user agents displaying non-English / ASCII
error page translations. Our translation system uses and produces UTF-8
templates for the langpack content.
It also encourages UTF-8 usage in third-party error pages.
Amos Jeffries [Mon, 20 Jan 2014 01:11:58 +0000 (14:11 +1300)]
cachemgr: Enable per-report Content-Type header
The default for all reports is plain text in UTF-8.
NOTE: UTF-8 selected because although current reports limit themselves
to ASCII character ranges, some reports may contain text pulled from the
protocol transferred and UTF-8 display covers most unexpected cases.
Amos Jeffries [Fri, 17 Jan 2014 11:44:26 +0000 (03:44 -0800)]
Fix external_acl_type async loop failures
When externa_acl_type uses %LOGIN and is required to trigger async
authentication lookups it returns and hits the async loop prevention
check when starting to trigger its own external helper lookup. This
results in a DUNNO output from the helper as final status instead of
the real helepr lookup result.
Avoid these by allowing async helpers to loop several times before
aborting the lookups.
Also, extend debug message to indicate loop count.
Thanks to Peter Benko for trackign down the issue and testing solutions.
Amos Jeffries [Wed, 15 Jan 2014 02:11:05 +0000 (15:11 +1300)]
Cleanup: Fix StoreIOBuffer initialization cases
When StoreIOBuffer isconstructed with an invalid (negative) size for the
content data mark it as an error immedately and set a valid length of
zero bytes.
Also, remove some unnecessary code in store_client.cc resulting.
This patch investigates the Ipc::MemMap class which is a shared cache with
timeouts for use with squid SMP.
TODO: Ipc::MemMap class has similar interfaces and functionality with the
Ipc::StoreMap class. These two classes should implemented as kid classes of
an Ipc::SharedCache class which encompass features from Ipc::MemMap and
Ipc::StoreMap classes.