Alex Rousskov [Fri, 4 Apr 2008 16:26:01 +0000 (10:26 -0600)]
Moved AccessCheck object creation and check starting to AccessCheck::Start.
We may be able to simplify the callers further by migrating to the AsyncJobCall
interface for callbacks.
Alex Rousskov [Fri, 4 Apr 2008 05:31:40 +0000 (23:31 -0600)]
Added global Enabled flag to Adaptation::Config so that AccessCheck::Start
can check that instead of becoming dependent on each adaptation mechanism
and its config.onoff setting. Could have created a generic Registry of
all adaptation mechanisms instead.
Alex Rousskov [Thu, 3 Apr 2008 21:24:07 +0000 (15:24 -0600)]
Got rid of references to libtool.m4 because libtoolize does not require it
and we want to rely on packager's version anyway (just like with other
autotools-generated or provided files).
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 05:31:29 +0000 (23:31 -0600)]
Added an adaptation service group API to support groups of services. Current
code supports service sets and single-service groups. The former provides a
way to group interchangeable services together so that one (the "best"
available) service is applied to the message. The latter is an internal
feature to allow user to mix service and group names in squid.conf ACLs.
TODO: support service chains (as a service group) and perhaps group of groups.
Moved adaptation access rule state from being shared between ICAPClass and
ICAPAccessCheck classes into a dedicated AccessRule class. This simplifies
both classes and allows for checking access rules in the correct order.
Use group names when linking adaptation access rules to groups. This is less
efficient (especially since we are still using Vector iteration to find a
matching group) but much simpler. TODO: Optimize.
All adaptation services, access rules, and service groups now have a
finalize() method that is called after configuration parsing has been
completed but before the main loop starts. This allows to verify or optimize
name-based links to other services, rules, and groups.
Moved adaptation access check and group classes into their own files.
Added adaptation_service_set squid.conf option, deprecating icap_class. The
new option has more accurate documentation and does not depend on the
adaptation protocol so one can group eCAP and ICAP services.
Added adaptation_service_set squid.conf option, deprecating icap_access. The
new option has more accurate documentation and does not depend on the
adaptation protocol so one can mix-and-match eCAP and ICAP ACL rules.
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.
Alex Rousskov [Mon, 31 Mar 2008 04:31:48 +0000 (22:31 -0600)]
Added generic support for loadable Squid modules or plugins.
The "loadable_modules" squid.conf option specifies what shared libraries to
load dynamically. The support is based on libtool's ltdl library, which has
been integrated with Squid prior to this commit, along with the
--enable-loadable-modules ./configure option.
Loaded modules are currently never unloaded, but that may change.
Loadable modules are needed for eCAP, but loadable_modules code deals with
generic module manipulation, independent from eCAP support.
TODO: support cachemgr reporting and reconfiguration.
Alex Rousskov [Sun, 30 Mar 2008 19:48:34 +0000 (13:48 -0600)]
Renamed types and members after moving adaptation-method-agnostic APIs to the
Adaptation namespace and adding support for delayed adaptation service
creation.
Alex Rousskov [Sun, 30 Mar 2008 19:40:57 +0000 (13:40 -0600)]
Renamed types and members after moving adaptation-method-agnostic APIs to the
Adaptation namespace and adding support for delayed adaptation service
creation.
Alex Rousskov [Sun, 30 Mar 2008 19:13:51 +0000 (13:13 -0600)]
Moved configuration options that do not depend on the adaptation method
from ICAP/ICAPConfig to adaptation/Config. ICAP and eCAP will not share
the same base configuration but will share the same base configuration code
(i.e., there will be two independent ICAPConfig and ecap::Config objects,
but they will have a common parent).
Implemented delayed creation of adaptation services. We used to create
ICAPServiceRep objects when parsing the configuration file.
Create-as-you-parse is imperfect for several reasons, especially if the
services are dynamically loaded as is the case with eCAP. We now remember the
service configuration and then create the actual service object _after_ the
configuration has been parsed and loadable modules, if any, have been loaded.
No functional changes are expected from this change.
Alex Rousskov [Sun, 30 Mar 2008 19:06:02 +0000 (13:06 -0600)]
Moved ICAP/ICAPInit* classes to adaptations/Init* classes.
This move helps Squid core code to manage adaptations without referring
to a specific adaptation mechanism. No functional changes are expected,
although InitiateHolder has been polished to prevent dereferencing of
invalidated Initiator.
Alex Rousskov [Sun, 30 Mar 2008 19:00:57 +0000 (13:00 -0600)]
Moved ICAP/ICAPInit* classes to adaptations/Init* classes.
This move helps Squid core code to manage adaptations without referring
to a specific adaptation mechanism. No functional changes are expected,
although InitiateHolder has been polished to prevent dereferencing of
invalidated Initiator.
Alex Rousskov [Sun, 30 Mar 2008 18:20:14 +0000 (12:20 -0600)]
Migrating from ICAP-specific API to generic "adaptation" API.
Core Squid code should not care about the specific adaptation mechanism in
use.
This change should not affect Squid functinality.
The migration is not complete because the on/off switch is still
ICAP-specific and because comments, debug, and error messages may still
refer to ICAP.
Alex Rousskov [Mon, 24 Mar 2008 15:11:15 +0000 (09:11 -0600)]
Extract service URI scheme and store it as the service protocol. This will
allow us to distinguish between ICAP and eCAP services, at least in the
begining of eCAP support.
Alex Rousskov [Thu, 20 Mar 2008 17:48:37 +0000 (11:48 -0600)]
Importing CVS squid3-ecap branch:
lib/Makefile.am
Added libLtdl to SUBDIRS if USE_LOADABLE_MODULES.
src/ICAP/ICAPModXact.h
src/ICAP/ICAPServiceRep.h
When USE_ECAP_AS_ICAP_HACK macro is defined, enable a temporary
hack that uses ICAP class names to implement some of the eCAP
classes. This is necessary to hide eCAP/ICAP distinction from
Squid core. Hiding the distinction is necessary to avoid
numerous conflicts when this branch is merged with async call
branch changes.
Once the branches are merged, the hack will be removed. Since
we currently #define eCAP class names to match those of ICAP
classes, the changes at that time should not be significant:
remove renaming #defines and adjust autotools meta files to
allow both ICAP and eCAP co-exist.
configure.in
src/Makefile.am
Enable eCAP support if loadable module support is enabled.
Eventually, we may want to control eCAP support directly.
Added eCAP directory to the Makefile. The eCAP directory
contents will be committed later.
SPONSORS
Added eCAP sponsor.
src/Makefile.am
When eCAP is enabled, to support USE_ECAP_AS_ICAP_HACK, ignore
ICAP files that eCAP overwrites.
configure.in
Added --enable-ecap option to control eCAP support explicitly.
Added consistency checks for the combination of --enable-ecap,
--enable-icap-client, and --disable-loadable-modules options.
Define USE_ECAP_AS_ICAP_HACK macro to enable a temporary hack
that uses ICAP class names to implement some of the eCAP
classes. This is necessary to hide eCAP/ICAP distinction from
Squid core. Hiding the distinction is necessary to avoid
numerous conflicts when this branch is merged with async call
branch changes.
Once the branches are merged, the hack will be removed. Since
we currently #define eCAP class names to match those of ICAP
classes, the changes at that time should not be significant:
remove renaming #defines and adjust autotools meta files to
allow both ICAP and eCAP co-exist.
Added basic support for Libtool ltdl. Libltdl directory is not
committed yet because I want to investigate whether it can be
moved from root to lib/. Bootstrap.sh currently strips a large
copying file from that directory but does not attempt to move
the directory itself.
The configure options will need to be changed according to
squid-dev discussion: we should assume that ltdl is always used
if modules are used, and we should have a --disable-modules
option.
The code works with a dummy module: Squid was able to load and
unload using LoadableModule, an ltdl wrapper class from Spicer.
I have not committed that wrapper yet.
Moved Libtool libltdl directory to lib/libLtdl to keep all
3rd-party libs in one place. Will commit the lib/libLtdl
directory itself soon.
Bootstrap.sh currently moves all files from the generated
libltdl into lib/libLtdl. A better approach may be to use the
--ltdl option of libtoolize. Will investigate.
Changed configure options to assume that ltdl is always used if
modules are used.
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.