Fallback on transparent interception mode even if the connection didn't seem
to be transparently intercepted
Needed to deal properly with situations where connections to the local host
is intercepted, or when people NAT outside the Squid server but still compile
Squid with support for the NAT/interception method availabe on the host OS..
Selectively roll comm_connect_addr part of the Linux leak fix out of trunk.
The IPAddress and configure parts are left to simplify future testing of why it
does not work in FreeBSD and what went wrong with the sockaddr_storage.
Attempted fix for FreeBSD run-time socket error "(22) Invalid Object" on connects
- Sets the ss_len / sin_len / sin6_len fields of sockaddr_* objects
when retrieved for connection setup.
- Tests the OS at compile time for each of these fields existence to
cope with some OS (ie Linux) not using or providing them.
Alex Rousskov [Thu, 3 Apr 2008 04:41:41 +0000 (22:41 -0600)]
Honor 0x and 0 prefixes as numeric base indication when parsing squid.conf
integer options.
Squid3 parses squid.conf file integers as decimal numbers while Squid2 honors
0 and 0x prefixes (indicating octal and hex numbers). The later functionality
is needed for things like unmask that are traditionally specified using octal
format.
This patch changes Squid3 behavior to match that of Squid2.
Internally, Squid3 uses sscanf and Squid2 uses strtol.
TODO: Squid3::GetInteger should probably use xatol,
and xatol should be fixed to proper verify the result of strtol.
Amos Jeffries [Thu, 20 Mar 2008 11:30:19 +0000 (23:30 +1200)]
3.1 Cleanups pt 1: Add testheaders.sh script
This script automatically tests all .h files in any directory it is passed
(relative to curent make directory) using the compiler options it is also passed.
It should be integrated in to the unit-testing in every Makefile.am so that
it provides dependancy tree testing of all .h without any additional work by
developers, maintainers, or testers.
- puts testheaders.sh script to use in many Makefile.am
(tried for all subdirs tested, but some may have escaped)
- fixes many include problems where .h were not self-sufficient.
They required .cc or other .h files using them to include additional .h
Now any given .h will include all objects it requires for compiling.
(linking is still not guaranteed by this alone)
- References SQUIDHOSTNAMELEN properly as defined by RFC 2181.
Now also split into a proper rfc2181.h for use.
(obsoleting many dependencies on squid.h all by itself)
- Migrates dlink_* (squid custom double-linked-list code) into new object.
(releasing many dependencies on squid.h, structs.h, and protos.h)
- Migrates the SquidConfig* types into SquidConfig.cc, now built into libsquid.la
(releasing many dependencies on structs.h, and globals.*)
- removes squid.h includes from many unit-tests
(releasing them from link-dependencies, .o links not yet cleaned up)
Henrik Nordstrom [Thu, 20 Mar 2008 05:15:04 +0000 (06:15 +0100)]
At the sprint the issue about our current 10ms main loop timeout came
up, and it was suggested the problem most likely have been fixed in
HEAD. And even if it hasn't been fixed it's something which should be
fixed rather than plastered over by spinning around on a short timeout
when there is no activity..
This backs out the change to revert the change..
Alex commit reversing the change said:
revno: 8332
committer: rousskov
branch nick: HEAD
timestamp: Tue 2007-07-24 01:55:21 +0000
message:
Reversed bug #2011 fix because it may slow down ICAP, BodyPipe, and other code
using zero-delay events to implement "asynchronous" calls.
The code should probably be rewritten (a) to avoid any waiting/blocking when
there are ready events and (b) to allow waiting longer when there are no ready
events.
Author: Robert Collins <robertc@robertcollins.net>
This is most of a changeover of scripts for squid 3 trunk to use bzr;
the missing bit appears to need a bzr 1.1 (to do 'rdiff' basically) or
thereabouts, I'll look into that in a bit. I'm not sure that the
unconverted cvs calls will actually trigger with our current setup or
not.
amosjeffries [Wed, 27 Feb 2008 04:49:32 +0000 (04:49 +0000)]
Merge auto-docs branch. pt 2
- Updates build config (dyn,html) for portable dynamic and static docs
- Merges all code-comment changes
- Updates some function parameter types to reduce silent conversions
- Fixes some typos.
- Migrates some TODO items to the automatic TODO list.
rousskov [Wed, 27 Feb 2008 01:43:30 +0000 (01:43 +0000)]
Bug #2224 fix: reentrant debugging crashes Squid
Reentrant debugging occurs when something being written into the debugging
stream produces its own debugging. For example, a field accessor method may
make cbdata-validation calls, which would produce debugging. Logging such
field would crash Squid if sufficiently high debugging level is enabled.
With this change, the Debug methods detect reentrant calls and mostly ignore
them, allowing the caller to append debugging information to the existing
debug stream. A short debugging label is added before and after the reentrant
debugging message to reduce confusion that overlapping debugging statements
may cause during log analysis.
rousskov [Tue, 26 Feb 2008 07:24:00 +0000 (07:24 +0000)]
Added a CPPUNIT assertion to test whether a failed CPPUNIT test case properly
destructs local objects on exit.
If a previous test case fails for any reason, the new assertion will fail
instead of store_dir.cc aborting. This may save us from tracking non-existent
StoreController initialization bugs.
rousskov [Tue, 26 Feb 2008 07:22:07 +0000 (07:22 +0000)]
Bug #2240 fix: AsyncCall-related unit tests fail
Removed EventDispatcher references, disabling the following test cases:
testRunOnce, testRegisterDispatcher, testRegisterEngine,
testEngineTimeout, testStopOnIdle.
Eventually, we will add AsyncCallQueue test cases, but EventLoop testing
does not have to wait for that.
rousskov [Tue, 26 Feb 2008 07:21:13 +0000 (07:21 +0000)]
Bug #2240 fix: AsyncCall-related unit tests fail
Removed EventDispatcher references, deleting testDispatch test case.
The test cases now use the AsyncCall queue to force call firing
without a real main loop.
Eventually, we will add AsyncCallQueue test cases, but event testing
does not have to wait for that.
rousskov [Tue, 26 Feb 2008 07:19:29 +0000 (07:19 +0000)]
Bug #2240 fix: AsyncCall-related unit tests fail
Removed libsquid.la from SWAP_TEST_LDADD: Store-related test cases use comm
stubs. They must not include libsquid which provides the true comm code.
Added AsyncCall* sources to selected test cases: Every test case that needs
event.cc also needs AsyncCallQueue and AsyncCall. Placed all three in
$TEST_CALL_SOURCES variable and used as needed. This prevents test case
compilation failures due to undefined call-related symbols.
I suspect that there are more files in the same "calls" group, but it would be
a lot easier to identify them once we clean src/ up and group files into
subdirs and libraries.
rousskov [Tue, 26 Feb 2008 07:15:48 +0000 (07:15 +0000)]
Protos.h said to remove HttpRequestMethod.h #include when no method_t is used
by prototypes. Removed the header and adjusted other source files that relied
on that header being in protos.h.
serassio [Wed, 20 Feb 2008 03:15:09 +0000 (03:15 +0000)]
Author: Klaubert Herr <klaubert@gmail.com>
Patch to strip kerberos realm from username
This patch add a new option to squid_ldap_group to strip kerberos realm from
username received from squid.
This is useful when you make kerberos authentication on squid, and try to
authorize the user using ldap in MS Active Directory, quering for
sAMAccountName.
rousskov [Tue, 19 Feb 2008 04:54:07 +0000 (04:54 +0000)]
Bug 2224 fix: reentrant debugging crashes Squid
This patch does not fix the true/core problem, but it changes some pieces of
code that expose that problem. There are probably other pieces not masked
by this patch.