wessels [Sat, 14 Feb 1998 01:26:52 +0000 (01:26 +0000)]
From Henrik Nordstrom
- A built in memory leak detector. Activated when compiled with
--enable-xmalloc-debug-trace. Squid-1.2.beta14: Option -m to turn on
malloc tracing
- The printing of the memory tracing is turned on by using the -m option
when starting squid, or by setting the global variable xmalloc_trace to
true from a debugger. A useful GDB macro:
define malloc_info
printf "Allocation %d from %s:%d size %d\n", \
malloc_number($arg0), malloc_file_name($arg0), \
malloc_line_number($arg0), mallocblksize($arg0)
end
wessels [Sat, 14 Feb 1998 00:47:38 +0000 (00:47 +0000)]
From: Henrik Nordstrom <hno@hem.passagen.se>
This patch changes the content-type for type specified ftp transfers to
type=i -> application/octet-stream
type=a -> text/plain
wessels [Fri, 13 Feb 1998 06:35:58 +0000 (06:35 +0000)]
- Added -S command line option to double-check store
consistency with disk files in storeCleanup().
- Fixed a problem with transactional logging. In many
cases we were adding the public cache key and then
logging a delete for the private key. This is worthless
because during rebuild we could not locate the previous
public-keyed entry. Now we assert that only public-keyed
entries can be logged to swap.state. storeSetPublicKey()
and storeSetPrivateKey() have been modified to log an
ADD or DEL when the key changes.
- Fixed storeDirClean bug. Needed to call
storeDirProperFileno() so the "dirn bits" get set.
- Fixed a storeRebuildFromDirectory bug. fullpath[] and
fullfilename[] were static to that function and did
not change when the "rebuild_dir" arg did. Moved these
buffers to the rebuild_dir structure.
- In storeRebuildFromSwapLog, we were calling storeRelease()
for cache key collisions. This only set the RELEASE_REQUEST
bit and did not clear the swap_file_number in the filemap or
in the StoreEntry, so the swap file could get unlinked later
when it was really released.
wessels [Thu, 12 Feb 1998 14:03:04 +0000 (14:03 +0000)]
- Changed StoreEntry->object_len to ->swap_file_sz so we
can verify the disk file size at restart. Moved object_len
to MemObject->object_sz. Note object_sz is initialized
to -1. If object_sz < 0, then we need to open the swap
file and read the swap metadata.
- Changed store_client->mem to ->entry because we need
e->swap_file_sz to set mem->object_sz at swapin.
- Removed some superfluous checks for e->key != NULL in
storeSet*Key().
- Renamed storeSwapData structure to storeSwapLogData.
- Fixed storeGetNextFile to not increment d->dirn. Added
check for opendir() failure.
- Fixed storeRebuildStart to properly link the directory
list for storeRebuildfromDirectory mode.
wessels [Wed, 11 Feb 1998 01:39:36 +0000 (01:39 +0000)]
Changed error message generated when we read 0 bytes from the FTP
server control socket. Instead of a read error, call it an FTP
protocol error. Thats not really great either. maybe we need a new
ERR_ type.
wessels [Tue, 10 Feb 1998 07:55:03 +0000 (07:55 +0000)]
Changes to accomodate disk write failures:
0) The problem: file_close() doesn't always close the file immediately;
i.e. when there are pending buffers to write. However, after
calling file_close, we were also calling storeUnlockObject and
the lock count could become zero then. Bad things would happen
if we got a callback from a file_write after the lock count went
to zero. We need a way to prevent the file_write callback from
happening when we "close" the swapout FD.
1) the file_write() callback data must now be in the callback
database (cbdata). We can't add StoreEntry's to cbdata for a couple
of reasons. So now we use the swapout_ctrl_t structure for the
callback data. Previously this was used only for the file_open
process, but now we keep it around for the entire swapout duration.
A new element MemObject->swapout.ctrl points to this data strucutre
so we can re-access it from storeCheckSwapOut.
2) Changed the way write errors are handled by diskHandleWrite.
If there is no callback function, now we exit with a fatal
message under the assumption that the file in question is a log
file or IPC pipe. Otherwise, we flush all the pending write
buffers (so we don't see multiple repeated write errors from
the same descriptor) and let the upper layer decide how to handle
the failure.
3) Fixes to storeDirWriteCleanLogs. A write failure was leaving some
empty swap.state files, even though it tells us that its "not
replacing the file." Don't flush/rename logs which we have
prematurely closed due to write failures, indiciated by
fd[dirn] == -1. Close these files LAST, not before renaming.
wessels [Sat, 7 Feb 1998 00:47:07 +0000 (00:47 +0000)]
Fixed store_rebuild handling of SWAP_LOG_DEL. Don't want to call
storeReleaseRequest() directly, because it won't free up the fileno
and other things. Calling storeRelease will just call storeReleaseRequest.
Also don't write the ENTRY_SPECIAL entries to the swap.state log.
wessels [Thu, 5 Feb 1998 06:41:00 +0000 (06:41 +0000)]
- Take Stewarts MONOTONIC_STORE patch, remove the #else code
- create storeUnlinkFileno() to consolidate some USE_ASYNC_IO #ifdefs
- added storeKeyInit()
- added storeKeyNull()
- Fixed storeRebuildFromDirectory() FUM bug.
- Removed unused fileno stack stuff. replaced by MONOTONIC_STORE changes
- Fixed storeClientReadBody() and storeClientReadHeaders() to call
httpParseReplyHeaders()
- Modified storeDirOpenTmpSwapLog() to return whether or not the
existing swap.state file has any entries, so we know to use
storeRebuildFromDirectory.