]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
14 years agoLanguage: en updates
Amos [Tue, 3 May 2011 06:01:46 +0000 (18:01 +1200)] 
Language: en updates

14 years agoDocs: Polish url_rewrite_program description
Colin Coe [Tue, 3 May 2011 03:01:59 +0000 (15:01 +1200)] 
Docs: Polish url_rewrite_program description

14 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 3 May 2011 00:12:39 +0000 (18:12 -0600)] 
SourceFormat Enforcement

14 years agoDrop testAuth unit-tests
Amos Jeffries [Mon, 2 May 2011 13:04:21 +0000 (01:04 +1200)] 
Drop testAuth unit-tests

Preparing to move the tests into src/auth.

These old tests construction style also require quite a lot of dependencies
which include several loops causing problems in modern strict linkers.
Opted to remove now and stabilize trunk without it before re-adding simpler
auth unit tests.

15 years agotypo in ntlm_fake_auth
Amos Jeffries [Mon, 2 May 2011 02:33:27 +0000 (20:33 -0600)] 
typo in ntlm_fake_auth

15 years agoCleanup: base64 coder de-duplication and upgrade
Amos Jeffries [Mon, 2 May 2011 01:14:30 +0000 (19:14 -0600)] 
Cleanup: base64 coder de-duplication and upgrade

Markus Moeller has re-implemented several of the coder functions for use
by Kerberos helpers.

This patch seeks to de-duplicate them and combine the resulting code
back into the libmiscencoding.la "base64.h" implementation.

Changes include:

  * old function API renamed to old_*() and existing code update to use
the names. Some code has been updated to use the new API.

  * new estimator base64_encode_len()/base64_decode_len() functions added
to provide details of much much buffer space the output will require.

  * new API encoder and decoder functions added which accept caller
provided buffers and encode/decode an arbitrary string into them.

  * also fixes a bug where if the input text or output buffer was too
short the coder functions would crop a few bytes off the end of the result.
Noticable in Kerberos where token lengths are not fixed length.

Some optimizations have been added by myself over and above Markus changes:

  * optimized to short-circuit on several more variations of empty input
and nil result buffer.

  * sub-loop optimizations added to reduce the number of if() calls made
by the new code.

  * split encoder into terminated (C-str) and non-terminated variants.

Also documented both old and new APIs functions.

15 years agoAdd external_acl_type %EXT_LOG and %EXT_TAG format options.
James Bowe [Sun, 1 May 2011 12:10:37 +0000 (00:10 +1200)] 
Add external_acl_type %EXT_LOG and %EXT_TAG format options.

%EXT_LOG and %EXT_TAG are filled with the log= and tag= fields
returned by previous external ACLs.

-for a string that never changes after it is set, tag= is suitable.
-for a string that may need updating or overwriting by a later
external_acl, log= is suitable.

Under both circumstances it is conceivable that later external_acls
may need access to the tag= or log= values after they have been set
(e.g. for external_acl debugging, merging log messages, etc).

15 years agoBug 3203: pkg-config replacement broken on Windows
Amos Jeffries [Sun, 1 May 2011 03:03:37 +0000 (15:03 +1200)] 
Bug 3203: pkg-config replacement broken on Windows

15 years agoExtraced the write-to-store step from StoreEntry::replaceHttpReply().
Alex Rousskov [Thu, 28 Apr 2011 22:45:55 +0000 (16:45 -0600)] 
Extraced the write-to-store step from StoreEntry::replaceHttpReply().

This allows the caller to set the reply for the entry and then update the
entry and the reply before writing them to store. For example, the server-side
haveParsedReplyHeaders() code needs to set the entry timestamps and make the
entry key public before the entry starts swapping out, but the same code also
needs access to entry->getReply() and such for timestampsSet() and similar
code to work correctly.

TODO: Calls to StoreEntry::replaceHttpReply() do not have to be modified
because replaceHttpReply() does write by default. However, it is likely that
callers other than ServerStateData::setFinalReply() should take advantage of
the new split interface because they call timestampsSet() and such after
replaceHttpReply().

15 years agoBug 3205: SSL-bump is broken in trunk
Christos Tsantilas [Thu, 28 Apr 2011 19:32:43 +0000 (22:32 +0300)] 
Bug 3205: SSL-bump is broken in trunk

The bug appeared after commit with revno:11364 which fixes the Bug #3192.

In the case of SSL-bumped connections the ConnStateData::flags.readMore flag
must be reset (set to true) when we are switching to HTTPs,
because we have to read the new unencrypted HTTP request.
This patch reset this flag in ConnStateData::switchToHttps method.

15 years agoUpdate release notes on deny_info changes
Amos Jeffries [Thu, 28 Apr 2011 17:04:06 +0000 (05:04 +1200)] 
Update release notes on deny_info changes

15 years agoMove max_size and n_disk_objects to specific SwapDirs, remove updateSize().
Dmitry Kurochkin [Thu, 28 Apr 2011 12:23:55 +0000 (16:23 +0400)] 
Move max_size and n_disk_objects to specific SwapDirs, remove updateSize().

15 years agoPerformance: short-circuit reply_body_max_size ACL tests
Amos Jeffries [Wed, 27 Apr 2011 23:48:03 +0000 (11:48 +1200)] 
Performance: short-circuit reply_body_max_size ACL tests

In the common default case there are no reply body limits configured.
There is no need to construct ACL checklists for testing. This saves
one allocation and several locking/unlocking cycles per request.

15 years agoStore Config.Store.avgObjectSize in bytes.
Dmitry Kurochkin [Wed, 27 Apr 2011 23:40:56 +0000 (03:40 +0400)] 
Store Config.Store.avgObjectSize in bytes.

15 years agoChange SwapDir::max_size to bytes, make it protected, use maxSize() instead.
Dmitry Kurochkin [Wed, 27 Apr 2011 23:34:13 +0000 (03:34 +0400)] 
Change SwapDir::max_size to bytes, make it protected, use maxSize() instead.

15 years agoRemove updateSize() from Store and make it protected in SwapDir.
Dmitry Kurochkin [Wed, 27 Apr 2011 20:30:31 +0000 (00:30 +0400)] 
Remove updateSize() from Store and make it protected in SwapDir.

A new SwapDir public method swappedOut() added. It is called from
storeSwapOutFileClosed() to notify SwapDir that an object was swapped
out.

15 years agoChange Config.cacheSwap.swapDirs and StoreEntry::store() type to SwapDir.
Dmitry Kurochkin [Wed, 27 Apr 2011 19:05:15 +0000 (23:05 +0400)] 
Change Config.cacheSwap.swapDirs and StoreEntry::store() type to SwapDir.

This allows using SwapDir API without dynamic_cast.

15 years agoDo not call updateSize() from Rock::SwapDir::addEntry(), it is NOP for Rock.
Dmitry Kurochkin [Wed, 27 Apr 2011 14:01:49 +0000 (18:01 +0400)] 
Do not call updateSize() from Rock::SwapDir::addEntry(), it is NOP for Rock.

15 years agoChange SwapDir::cur_size to bytes, make it private, use currentSize() instead.
Dmitry Kurochkin [Wed, 27 Apr 2011 13:57:13 +0000 (17:57 +0400)] 
Change SwapDir::cur_size to bytes, make it private, use currentSize() instead.

15 years agoMake Store::currentSize() return size in bytes.
Dmitry Kurochkin [Wed, 27 Apr 2011 13:26:03 +0000 (17:26 +0400)] 
Make Store::currentSize() return size in bytes.

15 years agoCode polishing: move Rock store entry limit calculation to entryLimitAllowed().
Dmitry Kurochkin [Wed, 27 Apr 2011 02:29:22 +0000 (06:29 +0400)] 
Code polishing: move Rock store entry limit calculation to entryLimitAllowed().

15 years agoInitialize and cleanup Rock shared maps using RunnersRegistry API.
Dmitry Kurochkin [Wed, 27 Apr 2011 01:52:46 +0000 (05:52 +0400)] 
Initialize and cleanup Rock shared maps using RunnersRegistry API.

15 years agoRework shared queue for IpcIoFile, further optimize IpcIo notifications.
Dmitry Kurochkin [Tue, 26 Apr 2011 20:39:59 +0000 (00:39 +0400)] 
Rework shared queue for IpcIoFile, further optimize IpcIo notifications.

The patch implements a FewToFewBiQueue class that allows
communication between two group of processes.  The queue is used
in IpcIoFile and allows to have a single shared queue reader
state for each process (both diskers and workers).  This
continues the optimization started in r11279, see commit log for
more details.

The patch also decreases the number of shared memory segment used
by queues.  Before the change, FewToOneBiQueue used
(2*workerCount + 1) number of segments. Now FewToFewBiQueue uses
just three: for shared metadata, for array of one-to-one queues
and for array of queue readers.

15 years agoBug fix: A dirty last/unused item left after Vector<>::shift
Christos Tsantilas [Tue, 26 Apr 2011 10:15:04 +0000 (13:15 +0300)] 
Bug fix: A dirty last/unused item left after Vector<>::shift

This is an old Vector<> bug that left a dirty last/unused item after
shift(). This causes problems if stored values have destructors.

15 years agoMove shared queues to Ipc namespace.
Dmitry Kurochkin [Mon, 25 Apr 2011 19:29:41 +0000 (23:29 +0400)] 
Move shared queues to Ipc namespace.

15 years agoUse shared pages in IpcIoFile instead of passing data through shared queues.
Dmitry Kurochkin [Mon, 25 Apr 2011 19:24:35 +0000 (23:24 +0400)] 
Use shared pages in IpcIoFile instead of passing data through shared queues.

15 years agoFix queue index in IpcIoFile debug message.
Dmitry Kurochkin [Mon, 25 Apr 2011 16:04:59 +0000 (20:04 +0400)] 
Fix queue index in IpcIoFile debug message.

This could lead to out of bounds array access and segfault.

15 years agoRework shared object design and management API.
Dmitry Kurochkin [Mon, 25 Apr 2011 15:14:10 +0000 (19:14 +0400)] 
Rework shared object design and management API.

Before the patch, each shared object was responsible for allocating
and deallocating shared memory it uses.  As a result each object had a
shared and non shared portion.  Shared classes provided a pair of
static methods for creating and attaching to existing shared segments.

This is against how normal objects behave: normal objects are not
responsible for managing memory they use, they use the memory they are
given.  Besides the old approach mixes shared memory management and
object initialization logic.  The patch tries to improve this.

On the user side, the patch provides two functions for managing shared
objects:

* shm_new - allocates/deallocates shared memory, initializes the object
* shm_old - gives refcounted access to the object created by shm_new

Shm_new function returns so called Owner object.  It is not used for
working with the shared object, but to do shared memory
allocation/deallocation and object initialization.  This function will
be typically used in Squid master process to allocate shared memory on
startup.  On exit, the Owner object is deleted and shared object is
deallocated.

Shm_old function returns a refcounted smart pointer to the shared
object.  It does not allocate shared memory or initialize the object,
but just points to the object owned by the Owner.  Smart pointer
provides a simple way for working with the shared object.

On the internal side, the patch removes shared memory
allocation/deallocation from shared object class.  There is no more
local/shared parts.  Shared object class implementation is now similar
to an ordinary class.  The additional requirements for "shared"
classes are: the object must be a POD with no pointers to or
references; provides a static SharedMemorySize method for shared
memory size calculation; may need to use atomic primitives for safe
updates of data members.

All existing "shared" classes and code were converted to the new API.

15 years agoPortability fix: explicitly state dependency on libtool 2.2+ and enforce it
Francesco Chemolli [Sat, 23 Apr 2011 07:11:07 +0000 (09:11 +0200)] 
Portability fix: explicitly state dependency on libtool 2.2+ and enforce it

15 years agoPortability fix: always install libltdl and change autoconf initialization
Francesco Chemolli [Sat, 23 Apr 2011 05:32:01 +0000 (07:32 +0200)] 
Portability fix: always install libltdl and change autoconf initialization

15 years agoRemove obsolete XXX: IpcIoMsg objects are no longer sent over UDS.
Dmitry Kurochkin [Wed, 20 Apr 2011 18:45:33 +0000 (22:45 +0400)] 
Remove obsolete XXX: IpcIoMsg objects are no longer sent over UDS.

15 years agoTemporary fix for coredumps during shutdown cleanup. take06
Alex Rousskov [Thu, 21 Apr 2011 15:19:31 +0000 (09:19 -0600)] 
Temporary fix for coredumps during shutdown cleanup.

For a permanent fix, we need to avoid deleting fd_table while it is still
in use by others, such as DeferredReads, possibly by allowing event loop
to run during shutdown.

15 years agoDisable shared memory cache when not running in SMP mode.
Alex Rousskov [Thu, 21 Apr 2011 15:13:33 +0000 (09:13 -0600)] 
Disable shared memory cache when not running in SMP mode.

15 years agoPolished debugging messages.
Alex Rousskov [Thu, 21 Apr 2011 14:46:45 +0000 (08:46 -0600)] 
Polished debugging messages.

15 years agoDrop SUID priveleges when running RunnersRegistry actions.
Dmitry Kurochkin [Thu, 21 Apr 2011 06:53:12 +0000 (10:53 +0400)] 
Drop SUID priveleges when running RunnersRegistry actions.

Before the patch, Squid created shared memory segments as root and
workers failed to attach to it as non-root.

15 years agoDocs: clarify bits/bytes on delay pools
Amos Jeffries [Wed, 20 Apr 2011 07:11:27 +0000 (01:11 -0600)] 
Docs: clarify bits/bytes on delay pools

15 years agoAdd errpages option %b for proxy listening port
Amos Jeffries [Wed, 20 Apr 2011 06:07:08 +0000 (18:07 +1200)] 
Add errpages option %b for proxy listening port

Use getMyPort() to insert the forward-proxy listening port into error
pages and deny_info redirect URLs. This fixes the current port
hard-coding assumption in ERR_AGENT_CONFIGURE.

The %b option is added for this purpose as a temporary measure until the
codes are merged with the more flexible log formatting set.

This currently depends on squid.conf having a particular http_port
ordering with the forward-proxy port listed first.

15 years agoSourceLayout: Add enum Direction for AuthUserRequests state logics
Amos Jeffries [Wed, 20 Apr 2011 05:08:16 +0000 (17:08 +1200)] 
SourceLayout: Add enum Direction for AuthUserRequests state logics

The state of credentials lookup and handling is recorded by
authenticateDirection / AuthUserRequest::direction() and its per-scheme
helper methods AuthUserRequest::module_direction().

This formalizes and coordinates the state being returned by using a
shared enum.

The states can generally be considerd as:
 - LOOKUP with a helper still needs to validate the credentials
 - CHALLENGE if the helepr needs more info from the client
 - VALID if everything is fine and the credentials are known Good/Bad
 - ERROR if there is any problem with the state or credentials

TODO:
 This combination has highlighted a few strange things in the NTLM and
Negotiate states. Where known but Failed credentials are marked as ERROR.
This needs closer investigation why it is not a CHALLENGE in all auth
schemes.

 Also there is a little obfuscation of the cases around the generalized
fixHeader() calls. This will be handled in a followup patch.

15 years agoDo not leave a no-longer valid ThePagePool pointer behind the cleanup.
Alex Rousskov [Tue, 19 Apr 2011 22:40:17 +0000 (16:40 -0600)] 
Do not leave a no-longer valid ThePagePool pointer behind the cleanup.

15 years agoFixed compiler warnings about wrong printf() format for currentSize().
Alex Rousskov [Tue, 19 Apr 2011 22:35:32 +0000 (16:35 -0600)] 
Fixed compiler warnings about wrong printf() format for currentSize().

15 years agoMerged from parent (trunk r11387, v3.2.0.7+).
Alex Rousskov [Tue, 19 Apr 2011 22:36:00 +0000 (16:36 -0600)] 
Merged from parent (trunk r11387, v3.2.0.7+).

15 years agonegotiate_wrapper_auth: fix strict compiler warnings
Amos Jeffries [Tue, 19 Apr 2011 13:20:31 +0000 (01:20 +1200)] 
negotiate_wrapper_auth: fix strict compiler warnings

15 years agoAdjust FewToOneBiQueue to use IDs in [1, workerCount] range.
Dmitry Kurochkin [Tue, 19 Apr 2011 11:00:37 +0000 (15:00 +0400)] 
Adjust FewToOneBiQueue to use IDs in [1, workerCount] range.

This allows using KidIdentifier as queue id directly without +-1 math.

15 years agoCode polishing, s/mySharedSize/sharedSize/ for consistency.
Dmitry Kurochkin [Tue, 19 Apr 2011 05:50:31 +0000 (09:50 +0400)] 
Code polishing, s/mySharedSize/sharedSize/ for consistency.

15 years agoConvert most Segment::mem() calls to reserve().
Dmitry Kurochkin [Tue, 19 Apr 2011 05:20:17 +0000 (09:20 +0400)] 
Convert most Segment::mem() calls to reserve().

Now all shared structures properly reserve() memory.

15 years agoCleanup Pages initialization:
Dmitry Kurochkin [Tue, 19 Apr 2011 04:06:00 +0000 (08:06 +0400)] 
Cleanup Pages initialization:

* remove Pages::Init() and Pages::Attach()
* do init in SharedMemPagesRr::run()

15 years agoUnlink shared segments used by memory cache, using RunnersRegistry API.
Dmitry Kurochkin [Tue, 19 Apr 2011 03:56:16 +0000 (07:56 +0400)] 
Unlink shared segments used by memory cache, using RunnersRegistry API.

Implement static Unlink() method for Ipc::Mem::Segment and other shared
classes.

15 years agoOptimized the number of "queue is no longer empty" IpcIo notifications.
Alex Rousskov [Tue, 19 Apr 2011 04:31:53 +0000 (22:31 -0600)] 
Optimized the number of "queue is no longer empty" IpcIo notifications.

The original code relied on the writer (pusher) knowledge to decide when a
notification is needed. That code was simpler but it resulted in many
pointless notifications because the reader could have been busy processing the
last popped item and would have checked the queue after that processing
anyway. This would become especially wasteful when the reader pops multiple
requests before processing them (e.g. to do "elevator" seek optimization).

The intermediate implementation (not comitted) placed the reader state in
each queue. That was still fairly simple and worked OK, but it was not
addressing the needs of the disker readers. Diskers have many incoming
queues. If at least one incoming queue has requests, the disker is not
blocked and does not need a notification.

The last implementation allows all incoming queues of a single disker to share
the reader/disker state. The reader state is disassociated from the single
queue.  There is still some wasteful state updates when multiple queues are
iterated in FewToOneBiQueue::pop(), but their overheads should be very minor.
We need to figure out whether a single shared reader state can also be used
for workers though (each worker also has many incoming queues...).

Also added debugging and a few XXXs/TODOs to mark future work items.

15 years agoUse page-rounded size for MemStore size rather than stored size.
Dmitry Kurochkin [Mon, 18 Apr 2011 15:01:04 +0000 (19:01 +0400)] 
Use page-rounded size for MemStore size rather than stored size.

Also rename MemStore::cur_size to MemStore::theCurrentSize to avoid confusion
with the KB-based SwapDir::cur_size.

15 years agoTypos in 3.1 release notes
Amos Jeffries [Mon, 18 Apr 2011 14:42:25 +0000 (02:42 +1200)] 
Typos in 3.1 release notes

15 years agoPrint size in KB when warning about too large disk-cache maximum object size.
Dmitry Kurochkin [Mon, 18 Apr 2011 13:33:52 +0000 (17:33 +0400)] 
Print size in KB when warning about too large disk-cache maximum object size.

15 years agoDo not create shared memory pools and warn if we cannot cache a single item.
Dmitry Kurochkin [Mon, 18 Apr 2011 13:30:00 +0000 (17:30 +0400)] 
Do not create shared memory pools and warn if we cannot cache a single item.

15 years agoPrep for 3.1.12.1 and 3.2.0.7
Amos Jeffries [Mon, 18 Apr 2011 12:27:45 +0000 (06:27 -0600)] 
Prep for 3.1.12.1 and 3.2.0.7

15 years agoWarn if MemStore cannot support the configured maximum disk-cache entry size.
Dmitry Kurochkin [Mon, 18 Apr 2011 11:53:16 +0000 (15:53 +0400)] 
Warn if MemStore cannot support the configured maximum disk-cache entry size.

15 years agoImplement Ipc::Mem::Level().
Dmitry Kurochkin [Mon, 18 Apr 2011 10:37:52 +0000 (14:37 +0400)] 
Implement Ipc::Mem::Level().

15 years agoImprove statistic reporting for shared Rock caches.
Dmitry Kurochkin [Mon, 18 Apr 2011 10:28:07 +0000 (14:28 +0400)] 
Improve statistic reporting for shared Rock caches.

Rock cache is shared between multiple processes.  We need to make sure
cache related stats are not counted twice by different processes.  The
patch makes Rock store statistics to be reported by the disker process
only.

Some global variables for cache related stats are replaced with Store
class methods.  This is needed because it may be difficult or
impossible to correctly update these variables for shared caches.

The patch also fixes cache manager output for some requests like
mgr:storedir: Before the change stats from disker processes were not
surrounded with "by kidN".

15 years agoBundle pkg.m4 from pkg-config 0.25
Scott James Remnant [Mon, 18 Apr 2011 10:22:30 +0000 (22:22 +1200)] 
Bundle pkg.m4 from pkg-config 0.25

These macros are required for ./configure to run on an OS such as MingW.

The macro to detect pkg-config being present is usualy only bundled with
pkg-config. When there is no pkg-config installed ./configure will fail.
This allows our configure to detect the absence and mark some components
as unavailable or unusable.

15 years agoFix COSS build:
Dmitry Kurochkin [Sun, 17 Apr 2011 10:27:49 +0000 (14:27 +0400)] 
Fix COSS build:

* call MemAllocator::freeOne() instead of MemAllocator::free()
* add unused "how" argument to CossState::close()
* fix signed-with-unsigned comparison

15 years agoFixes NTLM and Negotiate auth assertion "RefCountCount() == 2"
Amos Jeffries [Sun, 17 Apr 2011 03:35:52 +0000 (21:35 -0600)] 
Fixes NTLM and Negotiate auth assertion "RefCountCount() == 2"

It turns out the replay cache and invalid RefCount cases this was added to
protect againt are not present anyway. After some minor cleanup to remove
double-calls in Negotiate things appear to run nicely.

NOTE:
 There is still a risk that these problem cases may in future occur, but
 meanwhile we need NTLM and Negotiate to be usable and efficient.
 The bugs resulting from those can be dealt with if/when they do occur.

15 years agonegotiate_wrapper_auth: various portability fixes
Amos Jeffries [Sat, 16 Apr 2011 14:43:18 +0000 (02:43 +1200)] 
negotiate_wrapper_auth: various portability fixes

15 years agonegotiate_wrapper_auth: version 1.0.1
Markus Moeller [Fri, 15 Apr 2011 11:51:15 +0000 (05:51 -0600)] 
negotiate_wrapper_auth: version 1.0.1

A helper to perform Negotaite authentication in both its Negotiate/NTLM
and Negotiate/Kerberos forms.
Makes use of additional Squid helpers after unwrapping the header token.

15 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 15 Apr 2011 00:12:31 +0000 (18:12 -0600)] 
SourceFormat Enforcement

15 years agoCall haveParsedReplyHeaders() before entry->replaceHttpReply().
Alex Rousskov [Thu, 14 Apr 2011 22:20:55 +0000 (16:20 -0600)] 
Call haveParsedReplyHeaders() before entry->replaceHttpReply().

HaveParsedReplyHeaders() sets the entry public key and various flags (at
least). ReplaceHttpReply() packs reply headers, starting swapout process.
It feels natural to adjust the entry _before_ we pack/swap it, but I may be
missing some side-effects here.

The change was necessary because we started calling checkCachable() from
swapoutPossible(). If haveParsedReplyHeaders() is not called before we swap
out checks, the entry will still have the private key and will be declared
impossible to cache.

15 years agoDo not create shared memory pools if caching is disabled.
Alex Rousskov [Thu, 14 Apr 2011 22:19:10 +0000 (16:19 -0600)] 
Do not create shared memory pools if caching is disabled.
Ipc::Mem::PagePool cannot handle zero capacity well.

15 years agoCheck that we do not overflow mmap(2) size argument.
Alex Rousskov [Thu, 14 Apr 2011 20:35:30 +0000 (14:35 -0600)] 
Check that we do not overflow mmap(2) size argument.

15 years agoPolished desired total memory size calculation.
Alex Rousskov [Thu, 14 Apr 2011 20:28:39 +0000 (14:28 -0600)] 
Polished desired total memory size calculation.

15 years agoAdded TODO to deal with page alignment.
Alex Rousskov [Thu, 14 Apr 2011 20:21:36 +0000 (14:21 -0600)] 
Added TODO to deal with page alignment.

Same may be needed (but for non-performance reasons) for
Ipc::Mem::Segment::reserve().

15 years agoUse off_t instead of int and size_t for segment sizes
Alex Rousskov [Thu, 14 Apr 2011 20:16:35 +0000 (14:16 -0600)] 
Use off_t instead of int and size_t for segment sizes
to be able to allocated larger than 4GB segments on some platforms.

Double check the newly created segment size using fstat().

15 years agoUse size_t instead of unsigned int for the page size to prevent int overflows
Alex Rousskov [Thu, 14 Apr 2011 20:12:44 +0000 (14:12 -0600)] 
Use size_t instead of unsigned int for the page size to prevent int overflows
when computing the total segment size.

Size_t is also more appropriate for memory object sizes, even though it is
very unlikely that page sizes will get bigger than an int can hold.

15 years agoMerged from parent (trunk r11379, v3.2.0.6+).
Alex Rousskov [Thu, 14 Apr 2011 16:58:28 +0000 (10:58 -0600)] 
Merged from parent (trunk r11379, v3.2.0.6+).

15 years agoPolished shared memory initialization sequence, using RunnersRegistry API.
Alex Rousskov [Thu, 14 Apr 2011 04:25:35 +0000 (22:25 -0600)] 
Polished shared memory initialization sequence, using RunnersRegistry API.

The master process is now responsible for initializing all shared memory
segments before starting kids. The kids do not create new segments and attach
to the already initialized segments instead. This approach may not scale for
ever, but it avoids more complex initialization synchronization via
Coordinator.

Do not use Strings for globals because current string memory pools do not
support early initialization.

15 years agoAdded RunnersRegistry, an API to register and, later, run a group of actions.
Alex Rousskov [Thu, 14 Apr 2011 04:22:25 +0000 (22:22 -0600)] 
Added RunnersRegistry, an API to register and, later, run a group of actions.

Useful for keeping general initialization management code (e.g., main.cc)
independent from specific initialization code (e.g., Ipc::Mem::Init) during
staged initialization and cleaning.

15 years agoSourceLayout: namesapce for Auth::User children
Amos Jeffries [Thu, 14 Apr 2011 02:40:59 +0000 (20:40 -0600)] 
SourceLayout: namesapce for Auth::User children

Also, shuffle the resulting classes into their own compilation units.

No Logic changes.
Have omitted shuffling or altering two Auth::Basic::User methods handling
the validation short-circuit since these shodul not be part of that class.
Followup patch will move them appropriately.

15 years agoCheck the limit early in hope to catch cases when it becomes zero.
Alex Rousskov [Wed, 13 Apr 2011 20:11:39 +0000 (14:11 -0600)] 
Check the limit early in hope to catch cases when it becomes zero.
We could support maps with zero limits, but they should not be needed for now.

15 years agoIncreased page size to 32KB so that most typical responses would fit
Alex Rousskov [Wed, 13 Apr 2011 19:30:46 +0000 (13:30 -0600)] 
Increased page size to 32KB so that most typical responses would fit
until we support multi-page caching.

Made cumulative page size limit configurable via cache_mem.

Implemented Ipc::Mem::Limit().

15 years agoUse size_t for cumulative shared pages limits instead of uint64_t
Alex Rousskov [Wed, 13 Apr 2011 19:28:58 +0000 (13:28 -0600)] 
Use size_t for cumulative shared pages limits instead of uint64_t
because cache_mem (Config.memMaxSize) is size_t.

15 years agoFixed comment typo.
Alex Rousskov [Wed, 13 Apr 2011 17:07:02 +0000 (11:07 -0600)] 
Fixed comment typo.

15 years agoFixed shared memory cleanup code -- we were not returning freed pages to Pages.
Alex Rousskov [Wed, 13 Apr 2011 17:03:08 +0000 (11:03 -0600)] 
Fixed shared memory cleanup code -- we were not returning freed pages to Pages.

Added Ipc::StoreMapCleaner API so that map users are notified when the slot is
about to be overwritten or freed. Users need a chance to update their state
(e.g., return the no longer used shared page) before the extra information in
the slot disappears.

15 years agoExplain why we do not implement Icp::StoreMapCleaner API (yet).
Alex Rousskov [Wed, 13 Apr 2011 17:02:23 +0000 (11:02 -0600)] 
Explain why we do not implement Icp::StoreMapCleaner API (yet).

15 years agoFixed how storeSwapOutStart() prevents repeated calls on failures.
Alex Rousskov [Wed, 13 Apr 2011 05:19:00 +0000 (23:19 -0600)] 
Fixed how storeSwapOutStart() prevents repeated calls on failures.

We used to release the entry to signal that swapout is not possible. That hack
worked for disk caching, but it prevents nearly all memory caching because
released entries cannot be cached in memory.

A polished solution is to explicitly remember whether we made the decision to
allow or reject a swapout. The decision is now stored in MemObject::SwapOut.

Call StoreEntry::checkCachable() from StoreEntry::swapoutPossible(). This
allows us to make the decision sooner in some cases. Needs more work because
some checks in the two functions overlap and "too many files" checks in
checkCachable() should not be there at all.

Added an XXX for the checkCachable() call at the end of swapout. Out of this
project scope.

15 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 13 Apr 2011 00:12:37 +0000 (18:12 -0600)] 
SourceFormat Enforcement

15 years agoFixed storeDirSelectSwapDirRoundRobin iteration for the "no cache_dir" case.
Alex Rousskov [Tue, 12 Apr 2011 22:59:05 +0000 (16:59 -0600)] 
Fixed storeDirSelectSwapDirRoundRobin iteration for the "no cache_dir" case.

Moved [shared] memory cache stats reporting, addressing an old FIXME.

15 years agoAdded basic stats reporting.
Alex Rousskov [Tue, 12 Apr 2011 22:58:25 +0000 (16:58 -0600)] 
Added basic stats reporting.

15 years agoFixed Ipc::Mem::PageStack::theSize type to be signed.
Alex Rousskov [Tue, 12 Apr 2011 22:02:13 +0000 (16:02 -0600)] 
Fixed Ipc::Mem::PageStack::theSize type to be signed.
Otherwise, unsigned zero theSize underflows in pop(), causing an infinite loop.

15 years agoPolished debugging.
Alex Rousskov [Tue, 12 Apr 2011 18:56:40 +0000 (12:56 -0600)] 
Polished debugging.

15 years agoFixed Ipc::Mem::Segment::reserve().
Alex Rousskov [Tue, 12 Apr 2011 18:47:31 +0000 (12:47 -0600)] 
Fixed Ipc::Mem::Segment::reserve().
It was returning the pointer to the end of the reserved area.

Added debugging.

15 years agoFixed signed-with-unsigned compiler warnings.
Alex Rousskov [Tue, 12 Apr 2011 18:26:55 +0000 (12:26 -0600)] 
Fixed signed-with-unsigned compiler warnings.

15 years agoManager: send User-Agent header from cachemgr.cgi
Amos Jeffries [Tue, 12 Apr 2011 11:33:32 +0000 (23:33 +1200)] 
Manager: send User-Agent header from cachemgr.cgi

Uses hard-coded string "cachemgr.cgi/" instead of progname to avoid
complications from alternative names and when running under a browser.

May be elided in transit however teh VERSION sent here will help the
queried proxy respond appropriate to the CGI capabilities as we extend
the types and content of reports coming back from the future releases.

15 years agoSourceLayout: add missing CredentialState.h
Amos Jeffries [Tue, 12 Apr 2011 06:01:32 +0000 (00:01 -0600)] 
SourceLayout: add missing CredentialState.h

15 years agoAdded initial shared memory cache implementation (MemStore) and integrated it.
Alex Rousskov [Tue, 12 Apr 2011 00:33:41 +0000 (18:33 -0600)] 
Added initial shared memory cache implementation (MemStore) and integrated it.

Like Rock Store, shared memory cache keeps its own compact index of cached
entries using extended Ipc::StoreMap class (MemStoreMap). Like Rock Store, the
cache also struggles to keep its Root.get() results out of the store_table
except during transit.

There are several XXXs and TODOs that still need to be addressed for a more
polished implementation.

Eventually, the non-shared/local memory cache should also be implemented
using a MemStore-like class, I think. This will allow to clearly isolate
local from shared memory cache code.

15 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 12 Apr 2011 00:12:32 +0000 (18:12 -0600)] 
SourceFormat Enforcement

15 years agoAvoid creating unlocked store_table entries when handling rebuild conflicts.
Alex Rousskov [Mon, 11 Apr 2011 23:50:50 +0000 (17:50 -0600)] 
Avoid creating unlocked store_table entries when handling rebuild conflicts.

Such StoreEntry objects persist until a hit locks and unlocks them (or the
replacement policy removes them?), creating SMP synchronization problems
because they are treated as in-transit objects even though their store slot
may be gone already.

15 years agoAdded TODOs to avoid creating unlocked store_table entries.
Alex Rousskov [Mon, 11 Apr 2011 23:49:57 +0000 (17:49 -0600)] 
Added TODOs to avoid creating unlocked store_table entries.

15 years agoSourceLayout: namespace for Auth::User
Amos Jeffries [Mon, 11 Apr 2011 14:08:54 +0000 (08:08 -0600)] 
SourceLayout: namespace for Auth::User

No logic changes.

15 years agoImport SN.png correctly as binary.
Amos Jeffries [Mon, 11 Apr 2011 06:09:21 +0000 (18:09 +1200)] 
Import SN.png correctly as binary.

15 years agoRe-fix icons/ FHS compliance
Amos Jeffries [Mon, 11 Apr 2011 06:05:36 +0000 (18:05 +1200)] 
Re-fix icons/ FHS compliance

It seems I was working out of an outdated copy of the FHS.
Current standards describe /var/www as deprecated.

Reverting the icons location back to where it started.

15 years agoSourceLayout: Shuffle InitAuthSchemes() to Auth::Init()
Amos Jeffries [Mon, 11 Apr 2011 03:25:32 +0000 (21:25 -0600)] 
SourceLayout: Shuffle InitAuthSchemes() to Auth::Init()

No logic changes.

15 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 11 Apr 2011 00:12:56 +0000 (18:12 -0600)] 
SourceFormat Enforcement

15 years agoBug 3183: Invalid URL accepted with url host part of only '@'.
Amos Jeffries [Sun, 10 Apr 2011 02:00:38 +0000 (14:00 +1200)] 
Bug 3183: Invalid URL accepted with url host part of only '@'.

3.0 results in an ICAP segfault handling these URLs.

Newer releases do not segfault as easily, but still accept the invalid
URL and there may be other unknown side-effects.

Makes the URL parser present ERR_INVALID_URL for this edge case.

15 years agoSourceLayout: namespace for Auth::Config children
Amos Jeffries [Sun, 10 Apr 2011 01:31:59 +0000 (19:31 -0600)] 
SourceLayout: namespace for Auth::Config children

No Logic changes.

Also, no code shuffling which should normally have been done with namespace.
Config children are currently too intwined with UserRequest children and
helper management. Logic changes are required before that can be done.