Alex Rousskov [Tue, 6 Sep 2011 20:42:29 +0000 (14:42 -0600)]
Polished cache_dir rebuild warnings.
Use DBG_IMPORTANT level, WARNING: prefix, and explain that the bad entry is
going to be ignored. While this is an improvement of the moved code, most
of these warnings are still not user-friendly as they report low-level
details that most admins cannot use.
Alex Rousskov [Tue, 6 Sep 2011 20:14:29 +0000 (14:14 -0600)]
Temporary fixed coredumps when isOpen() is called during shutdown cleanup.
For a permanent fix, we need to avoid deleting fd_table while it is still
in use by others, such as DeferredReads, possibly by allowing event loop
to run during shutdown.
Alex Rousskov [Tue, 6 Sep 2011 20:10:26 +0000 (14:10 -0600)]
Adjusted cf.data.pre to reflect cross-vectoring point adaptation plan support.
These documentation changes were somehow missed from the r11327 commit that
introduced support for dynamic adaptation plans that cover multiple vectoring
points.
Alex Rousskov [Tue, 6 Sep 2011 18:28:11 +0000 (12:28 -0600)]
Support maximum field width for string access.log fields.
Some standard command-line and some log processing tools have trouble
handling URLs or other logged fields exceeding 8KB in length. Moreover,
Squid violates its own log line format and truncates the entire log line
if, for example, the URL is 8KB long. By supporting .precision format
argument, we allow the administrator to specify logged URL size and
avoid these problems.
Limiting logged field width has no effect on traffic on the wire, with
the exception of log records if they are sent over the network, of course.
TODO: The name comes from the printf(3) "precision" format part. It may
be a good idea to rename our "precision" into max_width or similar,
especially if we do not support floating point precision logging.
TODO: Old code used chars to store user-configured field width and
precision. That does not work for URLs, headers, and other entries
longer than 256 characters. This patch changes the storage type to int.
The code should probably be polished further to remove unsigned->signed
conversions.
Alex Rousskov [Tue, 6 Sep 2011 17:57:57 +0000 (11:57 -0600)]
Send RST packet when closing an ICAP connection after a transaction error.
This helps identify abnormal transaction termination at the ICAP server. The
code is from a production-running branch and was proven useful in some
environments (especially if the ICAP service needs help correctly dealing with
prematurely terminated transfers), but it is not yet clear whether the
advantages of doing this on a regular basis outweigh the overheads. If not,
we will need a squid.conf parameter to control connection closing behavior.
Alex Rousskov [Tue, 6 Sep 2011 17:37:29 +0000 (11:37 -0600)]
Log ICAP_ERR_GONE ICAP transaction outcome when ICAP initiator disappears early.
In this case, "early" means "before the end of the ICAP transaction".
Previously, "catch all" ICAP_ERR_UNKNOWN outcome was logged into the
adaptation log in such cases, raising red flags that there is something wrong
with the ICAP service or Squid.
Bug 3243: Fix cases: raw-IPv6, case variant FQDN, internal request
* do not unwrap the Host header IPv6. URL is not unwrapped for the test.
They should be identical regardless of wrapping choice.
Also ipcache happily unwraps for the intercept resolution cases
* use matchDomainName() algorithm instead of strcmp(). It is tuned for
fast case-less domain comparisons. But does support wildcard matches
so add a check of domain string length first.
* bypass for requests about to be serviced internally. We have some nasty
code of our own re-writing the URL without updating the Host: header.
Thanks to Sergey Merzlikin and Jenny Lee for detecting these.
Alex Rousskov [Tue, 30 Aug 2011 15:45:20 +0000 (09:45 -0600)]
Use a time-based limit for the Rock Store rebuild loop.
Compared to the old counter-based limit, a time-based limit is better because
it allows us to quit right after a blocked I/O or quit sooner when I/Os become
slower. Similarly, a time-based limit often allows us to rebuild a much larger
number of entries at a time because most sequential read I/Os are very fast.
Alex Rousskov [Tue, 30 Aug 2011 03:39:39 +0000 (21:39 -0600)]
Improved disker timeout handling.
A disker timeout may happen because the disker is stuck doing an I/O or
because the worker has not received an "I/O results available" notification.
If there was no notification (e.g., because the disker got stuck before
completing UDS sending steps), it is still possible that the disker output
queue cointains completed I/Os. Try to process as many of those old queued
I/Os as possible before abandoning the rest of the I/O requests.
Reduce the number of "error: timeout" lines reported at level 1. When multiple
I/Os timeout, just report the fact of the timeout, not every timedout I/O.
Needs more work to report the actual timeout value for the longest-waiting
I/O.
Double check that we are not scheduling two timeout triggers, just in case.
Alex Rousskov [Mon, 29 Aug 2011 23:14:17 +0000 (17:14 -0600)]
Use a time-based limit for the disker I/O loop.
Compared to the old counter-based limit, a time-based limit is better because
it allows us to quit right after a blocked I/O or quit sooner when I/Os become
slower.
Alex Rousskov [Mon, 29 Aug 2011 21:02:27 +0000 (15:02 -0600)]
Initial support for breaking the "do all queued I/Os" loop.
As the old TODO explained, it is necessary to break the loop to
give IpcIo notifications and other Squid process activities to
progress when many I/Os are queued or after a slow I/O blocks
the disker process for a while. More work is needed to break
based on cumulative I/O time rather than I/O count.
Alex Rousskov [Mon, 29 Aug 2011 20:58:29 +0000 (14:58 -0600)]
Made FewToFewBiQueue::peek() check both incoming and outgoing queues
to find the oldest queued value. This may help when the delay is on
our side (i.e., we are not receiving or processing completed I/Os fast enough).
Dmitry Kurochkin [Sun, 28 Aug 2011 17:11:19 +0000 (21:11 +0400)]
Disable Rock store and shared memory cache if shared memory is not available.
The patch adds support for building on systems without POSIX shared
memory (e.g. OpenBSD). IpcIo DiskIO module and Rock store is not
enabled by default if shared memory support is not available. If IpcIo
or Rock store is explicitly enabled, but no shared memory support is
available, fail with error during configure. Fail with error at
runtime if shared memory cache is enabled but no shared memory support
is detected.
Latest squid never shows DNS errors for user. When the user tries to retrieve
web page from non-existent domain, ERR_CANNOT_FORWARD error appears,
which misleads both user and administrator.
Alex Rousskov [Fri, 26 Aug 2011 20:48:08 +0000 (14:48 -0600)]
Polished unused code.
The unused dlopen() call is actually useful to enable when lt_dlopen() reports
"file not found" errors for loadable modules that do exist but that Libtool
cannot load successfully due to undefined symbols or other errors.
This inability to correctly report a library loading error is a long-standing
Libtool bug, stemming from Libtool's desire to try and load several
differently named library files until one succeeds, losing true error
information in the process.
Bertrand Jacquin [Mon, 22 Aug 2011 14:45:52 +0000 (08:45 -0600)]
Bug 2662: cf_gen failure when cross compiling
Adds support for "./configure HOSTCXX=foo" to specify a host compiler
to build cf_gen with. If none is specified the normal build compiler will
be used.
Amos Jeffries [Sat, 20 Aug 2011 15:57:06 +0000 (03:57 +1200)]
Bug 2279: Log Format options to log server source IP and port
* Add %<a and %<p log format tokens
* Remove log_ip_on_direct configuration directive
* Rename %la to %>la and %lp to %>lp
* polish log format tokens and documentation
* de-duplicate tunnel.cc and forward.cc updateHierarchyInfo() code.
This last is the only logic change. It involved creating hier.note()
and shuffling bits of code around inside forward.cc to ensure
connection setup had a single function, startConnectionOrFai(), which
began the server connect process for all destination changes.
Amos Jeffries [Fri, 19 Aug 2011 03:35:19 +0000 (21:35 -0600)]
Converts the bulk of cf_gen to C++ OOP code.
* char* tree members to std::string. Which eliminates xstrdup() and
xis*() calls.
* structs to classes and replaces calloc/free with new/delete.
* link cf_gen_depends.cci directly to autoconf.h defines.
The result of these is that we can erase the dependencies on util.h,
time.cc, config.h, libcompat.la, libmisc.la and other libraries.
Directly fixing seevral build and cross-compile issues that keep appearing
on various OS.
TODO:
There is a bit further cleanup we can do. Replacing several classes with
std::list<std::string>.
Dmitry Kurochkin [Wed, 17 Aug 2011 23:59:03 +0000 (03:59 +0400)]
Fix make check and make distcheck.
Mostly Makefile changes. Libcomm stub moved to tests/ directory
to allow using it on Makefile.am *_SOURCES instead of directly
#including it in test sources.
Pawel Worach [Sun, 14 Aug 2011 12:42:59 +0000 (00:42 +1200)]
Fix NIS helper build on FreeBSD
Fails on clang++ and other strict compilers due to missing __cplusplus
checks in FreeBSD system headers and yp_prot.h typedefs bool unless
BOOL_DEFINED is defined.