Alex Rousskov [Sun, 8 Mar 2009 21:53:27 +0000 (15:53 -0600)]
Synced #includes after moving files around.
Use newly added ACLFilledChecklist for fast ACL checks. Its constructor locks
request and accessList, simplifying the caller code.
Use newly added ACLFilledChecklist for state-specific ACL code. Also, the
ACLChecklist::authenticated() method is now an AuthenticateAcl global
function. See ACLFilledChecklist addition log for rationale.
Alex Rousskov [Sun, 8 Mar 2009 21:37:32 +0000 (15:37 -0600)]
Removed some 140 SOURCEs of ufsdump, adding a few stubs. The program seems to
work on simple ufs cache files.
urlCanonical is currently an always-asserting stub. I am not sure what pulls
in urlCanonical. I know storeKeyPublicByRequest* require it, but I am not sure
which source requires storeKeyPublicByRequest. If the stub assertion fails on
some cache files, we will need to pull more sources or re-implement
urlCanonical.
The more sources are moved into libraries, the more difficult it may be to
write isolated, compact test cases or tools because test case stubs and
customizations may start to conflict with names defined in the libraries and
because pulling in a whole library might require defining more stubs. It is
not clear yet how real this concern is in general, but a lot of acl/
SourceLayout time was spent on making ufsdump build...
Alex Rousskov [Sun, 8 Mar 2009 21:29:22 +0000 (15:29 -0600)]
Split auth/libauth into two libraries:
- auth/libauth containing core authentication code (used, in part,
by the acl/libstate library) and not using acl/ libraries; and
- auth/libacls containing authentication-related ACL code (used to build
executables) and using acl/libstate.
The split was necessary to prevent circular dependencies among acl/ and auth/
libraries.
Added conditionally built libraries to libauth, eliminating the need for
AUTH_LIBS_TO_ADD. Use libtool to build those libraries.
Alex Rousskov [Sun, 8 Mar 2009 21:19:10 +0000 (15:19 -0600)]
Moved src/ACL* and a few related files into src/acl/.
Renamed ACL source files from ACLFoo.{cc,cci,h} to Foo.{cc,cci,h}.
Many targets in src/Makefile.am depended on selected ACL ACL*cc and related
sources. These targets depend on acl/* libraries now. As a part of this
cleanup and reorganization, the number of ufsdump sources went from about 160
to about 20.
Alex Rousskov [Sun, 8 Mar 2009 19:45:44 +0000 (13:45 -0600)]
Split ACL.{cc,h} and src/acl_noncore.cc into acl/Acl and acl/Gadgets, moving
high-level global functions into Gadgets and leaving basic API types in Acl.
Moved horrific acl_access::containsPURGE into aclPurgeMethodInUse to avoid
exposing basic ACL API to "strategy" templates and HTTP-specific PURGE method.
The aclPurgeMethodInUse global lives in acl/libacls, which is a top-level
library that already contains a lot of data-specific code.
Alex Rousskov [Sun, 8 Mar 2009 19:41:27 +0000 (13:41 -0600)]
Extracted transaction state storage and related checks from ACLChecklist into
ACLFilledChecklist. Context: SourceLayout: acl/, take 1
ACLChecklist contained many data members representing the state of the current
transaction (in a broad sense). These members and related methods depended
on complex types such as HttpRequest and ConnStateData. Any Squid code using
ACLChecklist (and there is a lot of that code) was, hence, dependent on these
types. These dependencies caused, among other things, huge SOURCES lists in
src/Makefile.am, often for trivial targets such as ufsdump and test cases.
ACLChecklist is an abstract class now (to make sure we do not accidentally
create it). ACLChecklist has only one kid: ACLFilledChecklist. The Filled()
global function can be used to cast ACLChecklist* to ACLFilledChecklist*.
Since all ACLChecklist objects have to be ACLFilledChecklist objects, the cast
is fast and safe. The cast allows us to avoid bloating ACLChecklist with
virtual methods that only make sense in ACLFilledChecklist context.
ACLFilledChecklist now contains state-specific members while ACLChecklist
contains basic check list logic. The code that organizes or passes through
ACL checks does not need to be exposed to ACLFilledChecklist and the data
types it depends on.
Furthermore, ACLFilledChecklist should not contain complicated checks either.
It should focus on maintaining the state. The checks should go into specific
ACLs. Otherwise, complex checks cause dependency cycles with higher-level
libraries that provide code for those checks and yet depend on having access
to ACLFilledChecklist to implement specific ACLs. Currently, only the
authenticated() method got moved to auth/Acl.{cc,h} to break the circular
dependency between acl/libs and auth/libs. More work in that direction will
probably be required as we move more src/* code into libraries.
ACLFilledChecklist constructor replaces aclChecklistCreate global. This
simplifies the initiating code of all fast ACL checks: the checks no longer
need to do manual state locking, duplicating aclChecklistCreate code.
Alex Rousskov [Sun, 8 Mar 2009 19:38:12 +0000 (13:38 -0600)]
Removed AUTH_LIBS_TO_ADD as unused. auth/libauth.la now includes conditionally
built auth libraries and src/Makefile.am no longer needs to know about them.
Alex Rousskov [Sun, 8 Mar 2009 19:34:36 +0000 (13:34 -0600)]
Moved src/ACL* and a few related files into src/acl/.
Renamed ACL source files from ACLFoo.{cc,cci,h} to Foo.{cc,cci,h}.
Many targets in src/Makefile.am depended on selected ACL ACL*cc and related
sources. These targets depend on acl/* libraries now. As a part of this
cleanup and reorganization, the number of ufsdump sources went from about 160
to about 20.
Alex Rousskov [Fri, 27 Feb 2009 15:45:17 +0000 (08:45 -0700)]
SourceLayout: src/auth, take 0: Moved src/AuthFoo* to src/auth/Foo*, polished.
SourceLayout: src/fs, take 0: Polished Makefiles.
These fixes should have no runtime effects and were triggered by an attempt to
make "make distclean" work. TODO: add Auth and Fs namespaces, rename classes.
Alex Rousskov [Fri, 27 Feb 2009 04:58:29 +0000 (21:58 -0700)]
Add a dummy file called testHeaders to CLEANFILES.
It is created by testheaders.sh and distclean does not know about it.
The change can be reversed when testheaders.sh and its users are fixed.
Amos Jeffries [Thu, 26 Feb 2009 03:58:09 +0000 (16:58 +1300)]
TestBed: correct log handling.
Removal of the log MUST happen after the log has been checked for a
successful run. Removal of run data MAY hapen before this.
Probably data SHOULD be removed early to prevent excess data between runs.
Alex Rousskov [Wed, 25 Feb 2009 20:35:16 +0000 (13:35 -0700)]
SourceLayout: src/fs, take 0
Simplified and documented STORE_* autotools variables.
All fs code is built as fs/lib*.a libraries now, no exception for
diskd and aufs "fake" legacy modules.
fs/* sources are no longer added to executables directly.
TODO: Add Makefiles to specific fs modules.
TODO: Add Fs namespace and rename fs classes accordingly.
testHeaders in fs/Makefile.am requires absolute source directories for
out-of-tree checks to work.
Removed src/ip/stubQosConfig.cc from STORE_TEST_SOURCES. It does not seem to
be needed in my tests. If it is needed, the stub file should be moved into
src/tests to avoid dependency on a source in a directory with a Makefile. If
the stub is not needed at all, it should be removed from the tree. Note that
src/ip/stubQosConfig.cc is non-empty only when --enable-zph-qos.
These changes were triggered by an attempt to make "make distclean" work.
Amos Jeffries [Mon, 23 Feb 2009 11:05:52 +0000 (00:05 +1300)]
Author: frencesco chemolli <kinkie@squid-cache.org>
testBed: add parallel make capability to build testing
This small patch to the test-suite system allows for parallel-make in
the test-suite (only on Linux). This will allow for shorter build-test
times on multicpu/multicore systems.
Amos Jeffries [Mon, 23 Feb 2009 09:41:36 +0000 (22:41 +1300)]
Author: Mark Nottingham <mnot@pobox.com>
Bug 2599: Idempotent start
As discussed on squid-dev, Squid shouldn't return a shell error when:
- starting squid, if it's already running
- stopping squid, if it isn't running
This is to make writing scripts that control squid easier.
Note that it should still notify the user, and should not affect other
operations (e.g., kill, rotate, parse).
Alex Rousskov [Fri, 20 Feb 2009 18:48:56 +0000 (11:48 -0700)]
Added CBDATA_NAMESPACED_CLASS_INIT to define static members of classes that
live in a namespace.
The alternative was to change CBDATA_CLASS_* macros so that the static member
name does not depend on the type. That may have been better, but perhaps there
are some, unknown to me, low-level reasons why unique member names are
required for class cbdata code to work.
Alex Rousskov [Thu, 19 Feb 2009 22:35:50 +0000 (15:35 -0700)]
Moved src/ICAP into src/adaptation/icap.
Moved src/eCAP into src/adaptation/ecap.
As a side effect, eCAP now tests its headers. MessageRep.h needed to include
config.h to pass the tests, which probably indicates a bug in some other
header (possibly enums.h).
Alex Rousskov [Thu, 19 Feb 2009 20:28:48 +0000 (13:28 -0700)]
Fixed default -I options: there are no headers in $(top_builddir)/lib/ but
there is autoconf.h in $(top_builddir)/include/
Fixed hard-coded OBJS dependencies: autoconf.h is in $(top_builddir)/include/
The bug apparently did not bother anyobody too much, adding to my suspicion
that we do not really need these hard-coded OBJS dependencies.
Alex Rousskov [Thu, 19 Feb 2009 19:00:01 +0000 (12:00 -0700)]
SourceLayout: src/base, take 0 with tweaks
Added src/base directory for fundamental, commonly-used code pieces that are
not large enough to warrant their own directories. Currently base/ contains
the beginning of AsyncCalls hierarchy, which may eventually get its own
directory.
Removed src/ip from the top-level SUBDIRS list. Made cf_gen compile without
libip.
Started building makefile includes, to be used in subdir makefiles:
src/Common.am and src/TestHeaders.am.
Alex Rousskov [Thu, 19 Feb 2009 18:19:37 +0000 (11:19 -0700)]
Moved header testing from Common.am to TestHeaders.am. Not all makefiles
using Common.am will use a standardized header test, at least for now.
We have makefiles that test headers in subdirectories, for example.
Alex Rousskov [Thu, 19 Feb 2009 07:16:14 +0000 (00:16 -0700)]
Added src/base directory for fundamental, commonly-used code pieces that are
not large enough to warrant their own directories. Currently base/ contains
the beginning of AsyncCalls hierarchy, which may eventually get its own
directory.
Reduced cf_gen dependencies so that it can be built before subdirectories,
as, apparently, required by BUILT_SOURCES.
Moved some libraries that are used by virtually all executables to COMMON_LIBS.
The list will probably grow as we try to reduce the insane complexity of the
current Makefile.am.
Alex Rousskov [Thu, 19 Feb 2009 07:15:47 +0000 (00:15 -0700)]
Added src/base directory for fundamental, commonly-used code pieces that are
not large enough to warrant their own directories. Currently base/ contains
the beginning of AsyncCalls hierarchy, which may eventually get its own
directory.
Alex Rousskov [Thu, 19 Feb 2009 07:14:08 +0000 (00:14 -0700)]
Copied common Makefile.am stuff seen in a few Makefile.ams to a single
Makefile "header". This avoids evil code duplication. This file should be
included by most Makefile.ams inside src/. Needs more work as some of the
copied code is questionable and more code can probably be extracted here. See
XXXs.
TODO: The .h dependency test script part seems pretty universal, but if
many subdirs need to customize it, we may want to put it into a separate
Makefile "header".
Alex Rousskov [Thu, 19 Feb 2009 07:11:38 +0000 (00:11 -0700)]
Removed src/ip from the top-level SUBDIRS list. That directory is not
a top-level subdirectory and it is already listed in src/Makefile.am.
The commit message introducing the change talked about libip being a "POD
library". I do not know what that is, but, hopefully, we do not really need to
make this kind of exceptions for any src/ libraries.
Amos Jeffries [Wed, 18 Feb 2009 10:58:53 +0000 (23:58 +1300)]
Author: Francesco Chemolli <kinkie@squid-cache.org>
String NG : basic SquidString updates pt 2
- finished the analysis of raw buffer exporting, divided among c-sting
and raw-buf access clients
- general sanitization
- reversal of some wrongly-renamed variables and comments
- implementation of SQUIDSTRINGPRINT and SQUIDSTRINGPH (placeholder) macros and
psize() function for printf-style calls
- implementation of, and migration to, String::size_type and String::npos
- de-inlining of pos(), rpos(), find() and rfind() calls
- implementation and use of a proper substr() call
Amos Jeffries [Wed, 18 Feb 2009 09:45:46 +0000 (22:45 +1300)]
SourceLayout: setup libcompat.la for portability primitives
This library forms an underlayer which intends to be seamless for the rest
of Squid.
For code to be eligible for inclusion at this lowest layer it must be
emulating or wrapping a piece of OS-provided API for use on other OS
where it is not provided.
Shared code which is unique to Squid is not portability.
API mappings which are OS-specific are all defined for their particular
OS in the os/* files.
API mappings which are provided by multiple OS or support libraries
are mapped in compat/*
Emulators are acceptable, though the aim should be to inline or template
most of the code so only .h are really needed.
Fixed typo in DelayTaggedBucket::stats.
Added comments.
String.cci doesn't need to include squid.h, config.h is enough
In errorpage.cc there is no need to drop to char* land, we can work with String.