wessels [Tue, 24 Oct 2006 10:48:10 +0000 (10:48 +0000)]
Alex reports getting coredumps (with high debugging) at process
exit because debug_log got closed, but was not set to NULL. Seems
like we should not call fclose() before exit so that destructors
can write debugging if necessary. The file will be closed anyway
when the process truly exits.
wessels [Thu, 19 Oct 2006 07:39:40 +0000 (07:39 +0000)]
bugfix: In clientProcessRequest(), the call to connNoteUseOfBuffer() was
moved from the beginning to the end of the function. This broke request
body processing because "conn->in.notYetUsed" was wrong at the time
of BodyReader creation. As a workaround we now subtract http->req_sz
from conn->in.notYetUsed when telling the BodyReader how much
data there is on the socket.
wessels [Fri, 13 Oct 2006 02:46:42 +0000 (02:46 +0000)]
Removing port 563 from the default SSL_ports and Safe_ports ACLs
under the assumption that this port (for secure NNTP) is very
rarely used through Squid, and that allowing it by default increases
the chance that it can be abused for generic tunneling.
adrian [Mon, 2 Oct 2006 07:34:18 +0000 (07:34 +0000)]
Fix/Add request-line parser debugging; fix bug with pipelined connection parsing
The unparsed request buffer was being relocated before the headers were being
parsed. That was fine - the request parsing used to happen with a copy of the
buffer - but now a copy isn't being made. The buffer relocation needed to be
changed to happen after the request was parsed.
adrian [Wed, 27 Sep 2006 19:17:52 +0000 (19:17 +0000)]
Replace the client-side request line parser
* remove the 'inbuf' copy during parsing;
* .. but create a 'url' temporary copy for now since the *URL() routines
in client_side.cc expect a mutable zero-terminated string;
I looked into it and it won't take much work to rework those routines
to take an immutable buffer.
adrian [Tue, 26 Sep 2006 21:19:22 +0000 (21:19 +0000)]
Various changes to break out the request parsing state and remove extra malloc/copies
* Create a HttpParser structure to encapsulate the current parsing state
* Add some functions to return the current request/header length with some checks
(which are expensive and should be inlined later once the code is proven to
work.)
* Use the connection buffer rather than a temporary buffer to parse the request
headers, saving a malloc and copy (the 'prefix' buffer)
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.