Amos Jeffries [Mon, 8 Oct 2012 04:27:26 +0000 (22:27 -0600)]
Windows: support customization of --prefix= via compat/autoconf.h
Rather than defining DEFAULT_PREFIX on the compiler command line this
builds its value into autoconf.h for use whenever needed. Avoiding
otential issues with buggy Makefile.am coding.
Also allows the --prefix value to be sourced from the autoconf internal
default settings instead of requiring a manual --prefix parameter for
SNMP module to build and link properly.
Removed unnecessary extern declarations.
Changed mismatching class/struct declaration in fde.h
Created default constructor for _fde_disk and moved there proper initialization
Removed some dead function declarations
Amos Jeffries [Wed, 3 Oct 2012 00:44:13 +0000 (12:44 +1200)]
Fix website config display of default settings
The website page cfgman builder script was omitted when adding the
DEFAULT_DOC parameter and making DEFAULT / DEFAULT_IF_NONE support
multi-line values.
Amos Jeffries [Tue, 2 Oct 2012 02:18:50 +0000 (14:18 +1200)]
Bug 3130: helpers are crashing too rapidly
As discussed quite many months ago. This reduces the FATAL when helpers
crash/exit to a critical level ERROR have responded with useful reply to
at least one lookup.
The result is that Squid can now cope with helpers written in languages
which cannot loop infinitely. For example; PHP helpers often exit after
a timeout, broken scripts written to respond and exit immediately,
and helpers which encounter some permissions error and respond only with
"ERR" or "BH" results before aborting.
Amos Jeffries [Tue, 2 Oct 2012 01:55:36 +0000 (13:55 +1200)]
Polish: de-duplicate helper statistics objects
* Combine the stats structure on per-helper server classes. For more
consistent statistic gathering.
* Add initStats() method to initialize statistics variables correctly.
Previously only done for some counters on stateless helper objects.
* Add missing accounting of pending lookups in stateful helper code.
* Add counter for replies received from the helper.
* Add reporting of replies received back from each helper.
There are no logic or decision making logics affected by these changes.
The new increment/decrement and stats are purely affecting statistical
report outputs.
FUTURE TODO:
* replace the 'busy' flag on stateful helpers with pending>0 check
as used by stateless helpers to indicate queue count.
Amos Jeffries [Mon, 1 Oct 2012 22:47:10 +0000 (10:47 +1200)]
Cleanup: remove a wrong TODO
Squid may need to use the hop-by-hop response headers. This is too early
to be removing them. the right place is in client-side before delivering
to the client. Squid already contains code to do it there.
Fixes one minor memory leak when IPv6 is disabled and parsing an IPv6
address. For example the default localhost ACL ::1 value.
Caught by Valgrind:
==26647== 384 bytes in 4 blocks are definitely lost in loss record 1,132 of 1,726
==26647== at 0x4C25A28: calloc (vg_replace_malloc.c:467)
==26647== by 0x65B441: xcalloc (xalloc.cc:75)
==26647== by 0x657B99: MemPoolMalloc::allocate() (MemPoolMalloc.cc:62)
==26647== by 0x5A95B1: acl_ip_data::FactoryParse(char const*) (Ip.h:66)
==26647== by 0x5AA8BD: ACLIP::parse() (Ip.cc:523)
==26647== by 0x5E0A80: ACL::ParseAclLine(ConfigParser&, ACL**) (Acl.cc:174)
==26647== by 0x4B0C0F: parse_line(char*) (cache_cf.cc:1252)
==26647== by 0x4B2076: parseOneConfigFile(char const*, unsigned int) (cache_cf.cc:518)
==26647== by 0x4B29D0: parseConfigFile(char const*) (cache_cf.cc:558)
==26647== by 0x546B81: SquidMain(int, char**) (main.cc:1372)
==26647== by 0x547445: main (main.cc:1215)
Regression fix: Handle dstdomain duplicates and overlapping names better
Since 3.2 changes to dstdomain overlap detection teh case of duplicate
wildcards has become a fatal error needlessly.
This silently ignores all exact duplicates, even if they are wildcards.
Also, adjust the message display to always display the longer of the
domains first. Since we are dealing with sub-domains it is the most
reliable indicator of which should be removed to safely fix the detected
issue.
Clarified some comments in HttpHeaderFieldStat
Sorted class forward declarations in HTtpHeaderTools
Fixed debug in RequestFlags.cc
Properly indented constructor in RequestFlags.h
class-ified AclAddress
Complete the task of splitting protos.h into more specific files
Remove inclusion of protos.h from most files
Clean CVS and arch file-tags up
Rework some module initialization code so that it is the callee's task and not the callers' to do feature-enabling
Added ssl-crtd option to the maximus build test
Changed many functions' linkage type from C to C++
Alex Rousskov [Mon, 10 Sep 2012 23:07:01 +0000 (17:07 -0600)]
Do not reuse persistent connections for PUTs to avoid ERR_ZERO_SIZE_OBJECT.
A compliant proxy may retry PUTs, but Squid lacks the [rather complicated]
code required to protect the PUT request body from being nibbled during the
first try or [also tricky] code to send 100-continue expectation requiredto
delay body sending. Thus, Squid cannot safely retry some PUTs today, and
FwdState::checkRetriable() must return false for all PUTs, to avoid
bogus ERR_ZERO_SIZE_OBJECT errors (especially for clients that did not
reuse a pconn and, hence, may not be ready to handle/retry an error response).
In theory, requests with safe or idempotent methods other than PUT might have
bodies so we apply the same logic to them as well.
This reopens Squid bug #3398, undoing trunk r11859 commit which attempted
to close that bug.
Alex Rousskov [Mon, 10 Sep 2012 22:38:09 +0000 (16:38 -0600)]
Do not chunk responses carrying a Content-Range header.
When Squid forwards a response with a Content-Range header,
ClientSocketContext::socketState() detects the end of the response range(s)
and returns STREAM_*COMPLETE to ClientSocketContext::writeComplete().
The latter thinks that the writing of the response to the client must be
over and calls keepaliveNextRequest() instead of writing the last-chunk
(if any). If the to-client response was chunked, the client gets stuck
waiting for that missing last-chunk.
The multipart Range request case was already excluded from chunking (or it
would probably suffer from the same problem). With this change, no
Content-Range responses will be chunked.
N.B. Some servers send Content-Range responses to basic GET requests
without a Range header, so the problem affects more than just Range requests.
TODO: A proper fix would be to rewrite ClientSocketContext::writeComplete()
and other code so that it does not mix internal ClientStream completion with
[possibly chunk-encoded] writing completion. This should probably be done
along with fixing ClientSocketContext::socketState() and other state-checking
code to ignore to-client persistence (flags.proxy_keepalive), which is not
related to the internal ClientStream state.
Implemented some more getters/setters for RequestFlags.
Moved from a preprocessor-backed conditional code to a compiler-backed conditional code for follow-x-forwarded-for