wessels [Wed, 24 May 2006 00:24:41 +0000 (00:24 +0000)]
Fix NULL pointer access with asyncio when Squid starts up over the disk
space limit.
We used to call squidaio_init() from DiskThreadsDiskFile::operator new.
But this only gets called when opening a file. If the first transaction
is to unlink a file, squidaio will be uninitialized.
I didn't see any other good places to call squidaio_init(). For now
I am calling it from within the squidaio module itself at the
start of each open, unlink/truncate, and stat call.
wessels [Tue, 23 May 2006 06:30:21 +0000 (06:30 +0000)]
Added "self" refcounted Pointer parameters to StoreIOState's STRCB, STFNCB,
and STIOCB callback functions. This is so that the StoreIOState
refcount doesn't go to zero during one of these callbacks.
wessels [Tue, 23 May 2006 01:58:51 +0000 (01:58 +0000)]
Merged storeIOState and StoreIOState into a single StoreIOState
class. Previously, StoreIOState was just a refcounted storeIOState.
I had concerns that mixed use of refcounted and non-refcounted
StoreIOState may be leading to cases where the object gets referenced
via the old-style pointer after the refcounted version had its count
go to zero and the memory was freed. This came about while
investigating bugzilla #1465.
removed StoreIOState-related prototypes from protos.h, and removed
some typedefs from typedefs.h.
Modified STFNCB (storeSwapInFileNotify, storeSwapOutFileNotify) and
STIOCB (storeSwapOutFileClosed, storeSwapInFileClosed) so that they
no longer take StoreIOState arguments. Their "data" arguments
easily lead to the corresponding StoreIOState. The only thing we
really lose here is the ability to assert that "data->sio" equals
the passed StoreIOState.
hno [Sat, 20 May 2006 19:15:14 +0000 (19:15 +0000)]
Minor cleanup of the meta TLV format to not add the incorrect STORE_META_END
at the end of the list (list ends by it's size). STORE_META_END has changed
a number of times over the history, and we have never cared about it but some
external tools (i.e. purge) apparently beleives what they read in the docs..
wessels [Sat, 20 May 2006 06:11:59 +0000 (06:11 +0000)]
Made stream outputting more consistent in Mem::PoolReport. Use a
const char * for the column delimiter instead of repeating "\t "
on each line. Always put the delimiter at the end of the (source code) line.
wessels [Sat, 20 May 2006 06:05:02 +0000 (06:05 +0000)]
Try to clean up cachemgr 'mem' output. Don't need to double up on
'%' now that we're not using printf. Use std::setprecision() on some
fields so they don't show up as "1e+01" etc.
wessels [Fri, 19 May 2006 02:31:12 +0000 (02:31 +0000)]
The patch for bug #1499 included debugging statments where printf tokens
did not match time_t type on FreeBSD. The time_t variables are now cast
in debugging calls.
hno [Thu, 11 May 2006 02:34:18 +0000 (02:34 +0000)]
Bug 1224 / 1530: Crash related to failed PUT/POST requests where
body processing may close the connection "in the middle" of client
side request processing.
wessels [Wed, 10 May 2006 03:48:51 +0000 (03:48 +0000)]
Removed the HttpHeaderEntry constructor that created a "blank" object.
It created problems with the parse() method because id had to be set
to something, but none of the http_hdr_type values were really appropriate,
not to mention they either triggered assertions or confused the statistics.
Now parse() is a static method that calls new HttpHeaderEntry after
parsing has been successful.
wessels [Tue, 9 May 2006 23:44:23 +0000 (23:44 +0000)]
Bug #1531: squid crashes short after starting
When HttpHeaderEntry was converted to a class with methods I added a
constructor that took no arguments. It initialized id to HDR_BAD_HDR.
If header parsing fails, HDR_BAD_HDR triggers an assertion in
the destructor. As a workaround id is now initialized to HDR_OTHER.
robertc [Tue, 9 May 2006 05:38:33 +0000 (05:38 +0000)]
More decoupling work:
Add a URL and URLScheme class to allow separating the url parsing logic from
HTTPRequest logic which are currently bi-dependent.
Add HttpRequestMethod class to replace the enum method_t, start using it.
Split squid_curtime out from globals and tools, so you can get access to time
without dragging in other dependencies.
wessels [Tue, 9 May 2006 01:57:30 +0000 (01:57 +0000)]
bugfix: Diskd has a loop that puts Squid to sleep for small amounts of
time when the queues size reach a threshhold. The time-to-sleep is
supposed to double each time through the loop, but struct timeval delay
was initialized inside the loop, rather than outside, which meant it
always slept for 1 microsecond.
wessels [Sun, 7 May 2006 21:13:24 +0000 (21:13 +0000)]
Backed out change where clientReplyContext held a FwdState::Pointer.
That change was to fix problems with re-forwarded reqeusts where
the FwdState refcount would go to zero. But it also introduced a new
bug where errors would not be sent to clients because the refcount
did NOT go to zero.
wessels [Sat, 6 May 2006 05:33:21 +0000 (05:33 +0000)]
new feature: squid -k restart
It allows the built-in parent "watcher" process to automatically
and immediately restart Squid.
-k restart uses SIGTTIN. It is almost the same as -k shutdown
except that it sets the exit status to 1 (instead of 0). Since the
exit status is non-zero, the parent (watcher) will start squid again
immediately.
-k restart is not supported on systems that dont have SIGTTIN.