ICAP cleanup of some cbdataReference misunderstanding.
cbdataReference should only be used to create additional callback references
to a cbdata object. The owner of the object is the owner and has automatic
rights to the object, and should not call cbdataReference.
adrian [Wed, 20 Sep 2006 06:59:26 +0000 (06:59 +0000)]
Bypass the expensive check to the allocator getStats() when obtaining inuse data
A lot of busy code calls getStats() to get the inuse values when calculating
queue length (diskthreads) and store memory use for object memory expiry.
This was destroying performance.
The changes implement a "shortcut" to obtain the inuse values for both the
malloc and mempool allocator. getStats() is still expensive for mempools
(as it does GC before updating all the statistics to get accurate information)
but code has been modified to not use getStats() where all it wanted was
inuse info.
adrian [Tue, 19 Sep 2006 13:56:57 +0000 (13:56 +0000)]
First part of a comm layer rework
* Remove new-style CommWrite, CommFill
* Add in a low-overhead C replacement for comm_read and comm_write
* Remove the difference between comm_write and comm_old_write; everything
is back to using the same API for now
* create a simple C-based read/write IO callback mechanism, used by
comm_read and comm_write
Whats left to do:
* convert accept/connect to using the new C-based read/write IO callback
mechanism (and remove the requirement to allocate/free transient
structures)
* rework the deferred read manager code somewhat
* then, remove the new-style CommRead code and use comm_read + whatever
the deferred read manager has become
* remove whats not being used
Fix bug 1218 by adding tests for the io engine of coss and ufs swapdirs after parsing completes, and providing a heuristic lookup for finding a DiskIOModule when none is specified.
adrian [Wed, 13 Sep 2006 21:54:21 +0000 (21:54 +0000)]
Fix a bug which resulted in objects being released after forwarding was complete.
This may have been my fault; but the forward code is all a bit weird at
the present time. Bring the forward logic back into line with squid-2.6.
This does need to be verified to be sure its doing the right thing.
It is, at least, resulting in cachable objects once again and hasn't
broken the FTP error page generation.
adrian [Sun, 10 Sep 2006 09:20:37 +0000 (09:20 +0000)]
Bug 1579, 1475 - fix unlinkd to reduce the number of fd_set references
Squid_MaxFD is limited to FD_SETSIZE because of the fd_set uses outside of
the select(unix/windows) code. This patch removes one of the last
remaining uses.
adrian [Sun, 10 Sep 2006 07:53:00 +0000 (07:53 +0000)]
Rework the transaction completion/aborting in the ftp code to fix bug 1592
The main problems in the code were:
* fwd->complete() was being called more than once
* everything was being funned through transactionComplete() which just
wouldn't call abort handlers in the case of an abort.
So, transactionAbort() will call comm_close() to properly kill the
transaction the squid-2 way. this is ugly and should be replaced by some
object state to indicate the connection has been closed and the object
is on its way out; the current way will end up deleting the class data
before the code stack is fully unwound!
transactionForwardComplete() is just a wrapper that makes sure fwd->complete()
is called -once-.
adrian [Thu, 7 Sep 2006 07:00:03 +0000 (07:00 +0000)]
Bug 1754: BodyReader was reading too much data from the socket buffer.
Fix the BodyReader read routine to only empty enough data to satisfy the
given Content-Length; rather than emptying the buffer entirely.
Some clients have a habit of stuffing a \r\n at the end of a POST body and
this was being (over)read and hitting an assertion.
Bugfix 1750 - support tunnelling of RTSP and other protocols that abuse HTTP by sending just the headers and then waiting for out of band indicators to finish the reply.
Valgrind support. Mainly rearranging of cbdata to make malloc debugging
easier.
Also adds a new environment variable MEMPOOLS replacing the -mc command line option
for disabling the use of memory pools. A lot of the pools is created
automatically before main() is started so command line options was
a bit too late.
Fix library link order in tests to more closely match what is used for the main
program. Notably this was causing problems for libsnmp, where the tests picked
up a system provided libsnmp instead of ours..