Amos Jeffries [Sun, 3 May 2009 13:02:50 +0000 (07:02 -0600)]
Wrap C++ headers. Fixes define clash with libcompat
ostream and family were including sys/types.h which causes
FD_SET rediefinition with libcompat at times.
Current autoconf allows these headers to be wrapped and config.h
included before to prevent this and other things.
Amos Jeffries [Sun, 3 May 2009 07:07:07 +0000 (19:07 +1200)]
Auto-Docs: Add \cpptest directive
This is a custom directive just for squid.
It's used by adding to the declaration documentation of a function or
class method and listing the name of a unit-test function which
tests the documented function/method. It may be used multiple times
in a single function if there are multiple unit-tests for it.
Though in general multiple unit-tests sequences should be done in one
testing function.
Author: Peter Pramberger <peter@pramberger.at>
Bug 2656: Pinger dies with general protection fault
tzset() explicitly performs actions previously done implicitly
by localtime() in most case. It appears that some VM do not have
the implicit setting so we need this.
regression fix bug #2583: pure virtual method called
The applied patch hid the problem, did not fix it.
This patch removes the applied patch and instead add an assertion check in
ClientHttpRequest::~ClientHttpRequest destructor just before call the
Adaptation::Initiator::announceInitiatorAbort method.
-Method TunnelStateData::Connection::error:
The xerrno is the errno values (EAGAIN, EINTR etc) not a COMM_XX error/flag.
- Methods TunnelStateData::writeServerDone,TunnelStateData::writeClientDone:
if the related connection fd closing (flag==COMM_ERR_CLOSING) just return
On one starting error condition the helper enters a read loop
without exit conditions. Made this exit when read was done
and shutdown helper as per behavior comment by the loop.
Now compiled with the same CFLAGS as the rest of Squid.
This is tested up to gcc 3.4 standards now. Some may still
be raised by later gcc versions.
- fixes const correctness on several functions and globals
- fixes .h wrapping on several files
- adds prototype definitions for all functions
- adds several missing includes
- adds docs for some functions to auto-doc output
TODO:
Not all code audited, only the bits shown broken right now.
This helper contains a large amount of nasty duplicate code
and re-implements several encryption algoritms that should
probably be sourced from secure places.
This patch reduces local variable names from UPPER case to lower.
Preventing clashes with previous systm defines. In this case only
DOMAIN and SERVER were actually clashing. But reduced all for safety.
Also wraps system includes with HAVE_ macros inline with Squid policy.
Many small fixes uncovered by the testbed layer #02
- failover recovery for valgrind support
- better error reporting and detection for epoll support
- better dependency detection and handling for ESI support
- ARP build error on FreeBSD
- hack: silence build error on ZPH QoS support (TODO fix)
TODO:
- fix ZPH support for BSD (Bug 2537)
- comm symbol duplication failures under gcc 4.3.2
Bug 2610: Detection and verification of ipfilter header files is incorrect
After much contention reg Solaris and FreeBSD the union between them
seems to be this:
- adding netinet/in.h
- adding netinet/ip_fil_compat.h (alternative to netinet/ip_compat.h)
- testing for netinet/ipl.h before netinet/ip_nat.h
Bug 2571: Squid with IPv6 fails to start on kernel without IPv6
Adds comm_open_listener() wrapper to perform IPv6/IPv4 failover on sockets
intended for listening only. Uses the wrapper in all places I can be sure of.
Open a port specially bound for listening or sending through a specific port.
This is a wrapper providing IPv4/IPv6 failover around comm_openex().
Please use for all listening sockets and bind() outbound sockets.
It will open a socket bound for:
- IPv4 if IPv6 is disabled or address is IPv4-native.
- IPv6 if address is IPv6-native
- IPv6 dual-stack mode if able to open [::]
When an open performs failover it update the given address to feedback
the new IPv4-only status of the socket. Further displays of the IP
(in debugs or cachemgr) will occur in Native IPv4 format.
A reconfigure is needed to reset the stored IP in most cases and attempt
a port re-open.
The ftp code uses the FtpStateData::restart_offset and
FtpStateData::restarted_offset to compute the offset in the case of
partial responses, but it must also set the
ServerStateData::currentOffset member variable.
This patch:
- completely removes the FtpStateData::restarted_offset member and uses
the ServerStateData::currentOffset member variable instead.
- adds the FtpStateData::setCurrentOffset(int64_t) and
FtpStateData::getCurrentOffset() public methods to allow set/get the
ServerStateData::currentOffset value
- reference the wiki FAQ URI
- reference the generic configuration manual URI
- add documentation about other config files now visible
- add -S option documentation
- remove -D option documentation
- alter the main text to reference ICP, HTCP, CARP and ICAP protocols
which are now readily available in Squid.
- removed references to obsolete dnsserver and its operations.
- generalized text about helpers
- removed reference to I/O driven (Async events is not true I/O driven)
Currently the fs related subsystem is broken in trunk, because of
linking problems. This patch:
- Add the files fs/Module.cc,h which are similar to esi/Module.* files
- Build a new library libfs.a
- The fs/aufs/StoreFSaufs.cc, fs/diskd/StoreFSdiskd.cc and
fs/ufs/StoreFSufs.cc now contain just fake pointers
- The FS::Init() method used to build ufs, aufs and diskd filesystems.
- The FS::Init method called in main.cc before the code which reads the
config files. The FS::clean() currently does not used.
- The coss file system initiated using the old way.
Amos Jeffries [Mon, 30 Mar 2009 02:13:10 +0000 (20:13 -0600)]
Polich Intercept code.
- cleans up some obscurity over data source and sink for me/client IPs.
- cleans up existing debugs
- adds new debugs to show NAT inputs and results at level-5
(non-result is common and left at level-9)
- adds new dbugs to show TPROXY result at level-5 like NAT results
Add to the squid binary dependecies the snmplib, the adaptation lib, the
esi lib and the common libs to force the squid binary rebuild when
one or more of the above libraries are changed
In ACLFilledChecklist::ACLFilledChecklist constructor the HttpRequest
parameter hides the ACLFilledChecklist::request member.
As a result acl's do not work at all and some cases squid crashes
(eg when dstdomain acls used)
Fix the wrong "ifndef" in the beggining of the ExtUser.h file.
The old "SQUID_ACLIDENT_H" refers to the include file "acl/Ident.h"
causing problems when both files included in a source file.
inside the IpAddress::IpAddress(IpAddress *s) constructor, the line
"operator=(s)" causing the constructor to recursively call itself,
causing segmentation fault.
Amos Jeffries [Sat, 21 Mar 2009 00:57:14 +0000 (13:57 +1300)]
Shuffle PF interception into its own function.
With this all of the transparent build options are independent, and may be
used in any combination. Squid is no longer bound to the single-firewall
interception support.
NP: one small note the PF lookup is slightly weird due to its altering
the local client address from the NAT information.
Alex Rousskov [Thu, 19 Mar 2009 19:31:31 +0000 (13:31 -0600)]
SourceLayout: esi/, take 1
Moved src/ESI* files into src/esi/.
Renamed ESI source files from ESIFoo.{cc,cci,h} to Foo.{cc,cci,h}.
Replaced implicit constructor-based Parser registration with an explicit call
to Esi::Init() which knows of all ESI parsers. Added Esi::Clean counterpart.
Made libTrie build conditional on ESI support being enabled.
No true source code changes except for parser initialization.
No functionality changes were intended.
No runtime tests with ESI performed.
TODO: I did not move the tests/ESIExpressions test into src/esi because
we need to fix the entire testing layout before we should start
moving individual tests: They currently depend on individual source
and object files in src/ and in tests/ and that kind of dependency
should not be multiplied but removed.