]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
18 years agoAdd HTTP status codes 416 and 417 to the list that Squid knows about.
wessels [Sat, 5 May 2007 06:16:32 +0000 (06:16 +0000)] 
Add HTTP status codes 416 and 417 to the list that Squid knows about.

Adding these new status codes to HttpStateData::cacheableReply()

18 years agoFTP will no longer send REST command if offset exceeds size.
wessels [Sat, 5 May 2007 06:14:17 +0000 (06:14 +0000)] 
FTP will no longer send REST command if offset exceeds size.

Added a check to FtpState::restartable to detect when the desired
restart offset is greater than (or equal to) the size reported by
the server.  If the server didn't report a size, then we won't
send/set the restart offset either.

18 years agoFixed "spec->length >= 0" assertion for FTP request with range
wessels [Sat, 5 May 2007 05:46:42 +0000 (05:46 +0000)] 
Fixed "spec->length >= 0" assertion for FTP request with range

An FTP request with range offset larger than the content length
would result in a negative spec->length.  With this patch
we detect the condition and return a 200, instead of 206, reply.

The reply may be bogus, depending on how the FTP server behaves.
For example, the reply may have non-zero content-length header,
but no actual content (because we told the FTP server to restart
beyond the content size).

A future patch will try to make sure that we don't send a restart
command beyond the known object size.

18 years agoAdd HTTP status codes 416 and 417 to the list that Squid knows about.
wessels [Sat, 5 May 2007 04:12:55 +0000 (04:12 +0000)] 
Add HTTP status codes 416 and 417 to the list that Squid knows about.

18 years agoRemoved repeated assertion from httpHdrRangeRespSpecPackInto
wessels [Sat, 5 May 2007 02:30:16 +0000 (02:30 +0000)] 
Removed repeated assertion from httpHdrRangeRespSpecPackInto

18 years agoAvoid memory leaks when submitting a NULL helper.
rousskov [Fri, 4 May 2007 21:40:12 +0000 (21:40 +0000)] 
Avoid memory leaks when submitting a NULL helper.

18 years agoRemoved casts from numeric types in debugs() statements.
wessels [Mon, 30 Apr 2007 22:56:09 +0000 (22:56 +0000)] 
Removed casts from numeric types in debugs() statements.

After converting debug to debugs, there were quite a few instances
of casts left over.  I removed casts for int, unsigned, long, and
one double.

18 years agoFixed buffer overflow bug in whois.cc.
wessels [Mon, 30 Apr 2007 22:38:19 +0000 (22:38 +0000)] 
Fixed buffer overflow bug in whois.cc.

Terminating null was written one byte past end of the buffer,
clobbering the dataWritten variable.  Caused an assertion for whois
replies longer than BUFSIZ (1024) bytes.

18 years agoCompile error: the address of `void sigusr2_handle(int)', will always evaluate as...
hno [Sun, 29 Apr 2007 23:45:18 +0000 (23:45 +0000)] 
Compile error: the address of `void sigusr2_handle(int)', will always evaluate as `true'

Not sure what the error really is about, but we don't need to print out
that address, the function name is better..

18 years agoThe hex/dec I/O format operators is in the std namespace
hno [Sun, 29 Apr 2007 23:35:52 +0000 (23:35 +0000)] 
The hex/dec I/O format operators is in the std namespace

18 years agoAuthor: Tsantilas Christos <chtsanti@users.sourceforge.net>
hno [Sun, 29 Apr 2007 04:26:37 +0000 (04:26 +0000)] 
Author: Tsantilas Christos <chtsanti@users.sourceforge.net>

Convert debug statements to debugs

18 years agoAdding a comment that tests/testUfs will fail when 'heap' is the only
wessels [Thu, 26 Apr 2007 22:01:31 +0000 (22:01 +0000)] 
Adding a comment that tests/testUfs will fail when 'heap' is the only
configured replacement policy.

18 years agoChange diskd default DebugLevel to 0
wessels [Wed, 25 Apr 2007 22:41:56 +0000 (22:41 +0000)] 
Change diskd default DebugLevel to 0

At DebugLevel = 1, diskd prints "errors" to cache.log when operations
such as open, read, and unlink fail.  These "errors" are not fatal.
In fact, some are to be expected due to the asynchronous nature of
diskd.  The upper layers of Squid are designed to handle these
"errors" gracefully.  They should not be in the log by default
because naive users may report them as bugs.

18 years agoBug #1940: assertion failed: store.cc:850
rousskov [Wed, 25 Apr 2007 20:37:55 +0000 (20:37 +0000)] 
Bug #1940: assertion failed: store.cc:850
Avoid calling writeReplyBody when there is no reply body data to write.

FtpStateData calls processReplyBody from several places. When called from
icapAclCheckDone we may not be expecting a body for this response. If no body
is expected, the store entry may not be in a STORE_PENDING state and when we
try to append [zero-sized] body data, the store asserts.

If no body is expected, we probably should not be calling processReplyBody!
Unfortunately, it was not obvious for me what we should call so I left the
call there and made it bypass store writing if there is no body content.

If you understand the FtpStateData logic, please try to make sure
processReplyBody is not called for objects without a body (it is possible that
something else should be called instead though). Please note that ICAP sets
virginBodyDestination when body is expected.

18 years agoAmos Jeffries' tidyup of the debugging sections.
adrian [Wed, 25 Apr 2007 17:30:14 +0000 (17:30 +0000)] 
Amos Jeffries' tidyup of the debugging sections.

18 years agoBootstrapped
hno [Wed, 25 Apr 2007 06:10:43 +0000 (06:10 +0000)] 
Bootstrapped

18 years agounit testing fix for tests/testCoss.cc
wessels [Wed, 25 Apr 2007 05:35:46 +0000 (05:35 +0000)] 
unit testing fix for tests/testCoss.cc

note that store_dirs_rebuilding is now initialized to 1 instead of 0

18 years agoFix tests/testCoss; storeSwapOut is now StoreEntry::swapOut
wessels [Wed, 25 Apr 2007 05:16:35 +0000 (05:16 +0000)] 
Fix tests/testCoss; storeSwapOut is now StoreEntry::swapOut

18 years agoFix 'unknown http status code in reply' for status 408 replies
wessels [Wed, 25 Apr 2007 05:13:25 +0000 (05:13 +0000)] 
Fix 'unknown http status code in reply' for status 408 replies

HttpStateData::cacheableReply complains about HTTP status codes
that aren't in the switch list.  I've added 408 (HTTP_REQUEST_TIMEOUT)
and others that were missing.

18 years agobootstrapped after henrik modified src/Makefile.am
wessels [Tue, 24 Apr 2007 22:23:40 +0000 (22:23 +0000)] 
bootstrapped after henrik modified src/Makefile.am

18 years agoSQUID_HELPER define for including squid.h from helpers
hno [Tue, 24 Apr 2007 21:04:22 +0000 (21:04 +0000)] 
SQUID_HELPER define for including squid.h from helpers

squid.h has some debugging stuff in it which should only apply to the main
squid binary, not various helpers also referencing squid.h.

This patch also splits the unlinkd helper from unlinkd.cc to unlinkd_daemon.cc
to make it more readable.

18 years agoReserver the oa and ot logformat tags for outgoing address/tos.
hno [Tue, 24 Apr 2007 21:01:55 +0000 (21:01 +0000)] 
Reserver the oa and ot logformat tags for outgoing address/tos.

18 years agobootstrapped after modifying lib/Makefile.am
wessels [Tue, 24 Apr 2007 12:35:52 +0000 (12:35 +0000)] 
bootstrapped after modifying lib/Makefile.am

Adding xusleep to libmiscutil

18 years agoFix for compiling src/unlinkd.cc with kqueue and epoll.
wessels [Tue, 24 Apr 2007 12:30:36 +0000 (12:30 +0000)] 
Fix for compiling src/unlinkd.cc with kqueue and epoll.

When Squid is compiled with --enable-kqueue or --enable-epoll, we're
not supposed to use any fd_set structures.  unlinkd.cc uses select()
to pause and wait for for feedback from the external unlinkd helper.
But when using kqueue or epoll, unlinkd.cc will have to use "usleep"
emulation rather than select.

The contents of lib/xusleep.c and include/xusleep.h have been copied
from Squid-2 sources.

18 years agoBootstrapped after fixing 'make check' for --disable-unlinkd
wessels [Tue, 24 Apr 2007 06:42:34 +0000 (06:42 +0000)] 
Bootstrapped after fixing 'make check' for --disable-unlinkd

18 years agoBootstrapped after fixing 'make check' for --disable-unlinkd
wessels [Tue, 24 Apr 2007 06:42:17 +0000 (06:42 +0000)] 
Bootstrapped after fixing 'make check' for --disable-unlinkd

Long summary

18 years agoFix 'make check' for --disable-unlinkd
wessels [Tue, 24 Apr 2007 06:40:25 +0000 (06:40 +0000)] 
Fix 'make check' for --disable-unlinkd

'make check' fails with --disable-unlinkd because the Makefiles refer
to unlinkd.cc, which should not be compiled when it is disabled.  Fixed
by changing references of unlinkd.cc to the $(UNLINKDSOURCE) macro.

18 years agoFixed "ftpReadTransferDone: Got code 426 after reading data" SEGV
wessels [Mon, 23 Apr 2007 23:50:49 +0000 (23:50 +0000)] 
Fixed "ftpReadTransferDone: Got code 426 after reading data" SEGV

Whenever ftpReadTransferDone got an unexpected status code, it would
also SEGV.  It happened because the FtpStateData object was destroyed
in the middle of the dataRead method, just before the final call to
processReplyBody.

A workaround seems to be to call scheduleReadControlReply with
buffered_ok=0 so that the object isn't destroyed within the
same call sequence.

I was tempted to put a return after the dataComplete call in
ftpReadTransferDone so that we won't call processReplyBody
when len == 0, but I'm concerned that may break things when ICAP
is in use.

18 years agoFix "store_status == STORE_PENDING" assertion in FTP with large responses
wessels [Mon, 23 Apr 2007 13:29:57 +0000 (13:29 +0000)] 
Fix "store_status == STORE_PENDING" assertion in FTP with large responses

An FTP object that exceeds reply_body_max_size leads to an assertion
failure.  The StoreEntry is aborted by the call to appendSuccessHeader(),
but the abort callback is delayed due to using events.  We need to
check for ENTRY_ABORTED (again) right after the appendSuccessHeader()
call -- yuck.

18 years agoAuthor: Tsantilas Christos <chtsanti@users.sourceforge.net>
wessels [Mon, 23 Apr 2007 12:11:55 +0000 (12:11 +0000)] 
Author: Tsantilas Christos <chtsanti@users.sourceforge.net>
Fix compile-time issue related to removing getRaw() uses.

Tsantilas says Squid won't compile with delay pools enabled after
I removed getRaw() here.  It seems to compile okay on FreeBSD (gcc
3.4.2), but it is certainly better to write "if (X == NULL)" rather
than "if (!X != NULL)".

18 years agoFix coredump bug when auth header contains invalid characters
wessels [Mon, 23 Apr 2007 11:50:37 +0000 (11:50 +0000)] 
Fix coredump bug when auth header contains invalid characters

Apologies for the previous empty commit message.  Here is what
should have been there.

When a Proxy-Authorization header contains invalid characters (ie
NL or CR), BasicUser::extractUsername will emit an error message
and the username will not be set.  However, extractPassword was
also being called and it does not check for funny characters in the
cleartext string.  Thus passwd was being set.  BasicUser::valid was
returning true because it only looked at the passwd.

This bugfix has three components:

1) BasicUser::valid now checks the username, as well as the password.

2) Moved the check for invalid characters to BasicUser::decodeCleartext,
   which now returns boolean.  We will not call extractUsername and
   extractPassword if decodeCleartext fails.

3) extractUsername was freeing the cleartext string, but not setting
   the pointer to NULL, thus causing a double-free in the BasicUser
   destructor.

NOTE that the previous commit left the invalid character check in
extractUsername, but I realized it fits better in decodeCleartext
while writing the commit message, which led to the empty log.

18 years ago*** empty log message ***
wessels [Mon, 23 Apr 2007 11:43:08 +0000 (11:43 +0000)] 
*** empty log message ***

18 years agoConvert most of the debug() to debugs()'s; just to see how difficult it is.
adrian [Sat, 21 Apr 2007 19:34:42 +0000 (19:34 +0000)] 
Convert most of the debug() to debugs()'s; just to see how difficult it is.
This is in preparation for converting chunks of the Http Header parsing and
management code to use C++ Strings (eventually..)

18 years agoBugfix from StoreEntry method conversion: hashInsert is now a method
wessels [Sat, 21 Apr 2007 19:21:58 +0000 (19:21 +0000)] 
Bugfix from StoreEntry method conversion: hashInsert is now a method

18 years agoConverted a more StoreEntry functions to class methods:
wessels [Sat, 21 Apr 2007 13:14:13 +0000 (13:14 +0000)] 
Converted a more StoreEntry functions to class methods:

destroy_MemObject       -> destroyMemObject
storeSetMemStatus       -> setMemStatus
storeHashInsert         -> hashInsert
storeHashDelete         -> hashDelete
storeCheckTooSmall      -> checkTooSmall
storeCheckCachable      -> checkCachable
storeEntryLocked        -> locked
storeKeepInMemory       -> keepInMemory
storeCheckNegativeHit   -> checkNegativeHit
storeEntryValidToSend   -> validToSend
storeTimestampsSet      -> timestampsSet
storeRegisterAbort      -> registerAbort
storeUnregisterAbort    -> unregisterAbort
storeEntryDump          -> dump
storeSetMemStatus       -> setMemStatus
storeUrl                -> url
storeCreateMemObject    -> createMemObject
storeEntryReset         -> reset

storeAppend             -> deprecated
storeBuffer             -> deprecated
storeBufferFlush        -> deprecated

18 years agoFix for --enable-cpu-profiling mode. Do not change PROF_start() arg.
wessels [Sat, 21 Apr 2007 13:10:06 +0000 (13:10 +0000)] 
Fix for --enable-cpu-profiling mode.  Do not change PROF_start() arg.

18 years agoConverted a few more StoreEntry functions to class methods:
wessels [Sat, 21 Apr 2007 05:53:41 +0000 (05:53 +0000)] 
Converted a few more StoreEntry functions to class methods:

InvokeHandlers
storeExpireNow
storeNegativeCache
storePurgeMem
storeReleaseRequest
storeSetPrivateKey
storeSetPublicKey

18 years agoChanged storeAbort() into StoreEntry::abort()
wessels [Sat, 21 Apr 2007 05:10:59 +0000 (05:10 +0000)] 
Changed storeAbort() into StoreEntry::abort()

18 years agoRemoved some uses of RefCount::getRaw()
wessels [Sat, 21 Apr 2007 04:24:07 +0000 (04:24 +0000)] 
Removed some uses of RefCount::getRaw()

We can compare RefCount pointers to NULL without using getRaw() as long
as the RefCount pointer is on the left, and NULL is on the right.

18 years agoRemoved some uses of RefCount::getRaw()
wessels [Sat, 21 Apr 2007 04:17:06 +0000 (04:17 +0000)] 
Removed some uses of RefCount::getRaw()

We can compare RefCount pointers to NULL without using getRaw() as long
as the RefCount pointer is on the left, and NULL is on the right.

18 years agoRemoved some uses of RefCount::getRaw()
wessels [Sat, 21 Apr 2007 04:06:44 +0000 (04:06 +0000)] 
Removed some uses of RefCount::getRaw()

We can compare RefCount pointers to NULL without using getRaw() as long
as the RefCount pointer is on the left, and NULL is on the right.

18 years agoRemoved a bunch of code marked UNUSED_CODE, OLD, and BROKEN_CODE
wessels [Fri, 20 Apr 2007 13:29:47 +0000 (13:29 +0000)] 
Removed a bunch of code marked UNUSED_CODE, OLD, and BROKEN_CODE

These sections of code have been marked unused for at least three
years now.  They have been removed.

18 years agoRemoving storeLowestMemReaderOffset() as unused.
wessels [Fri, 20 Apr 2007 12:54:48 +0000 (12:54 +0000)] 
Removing storeLowestMemReaderOffset() as unused.

This function was just a wrapper around MemOjbect::lowestMemReaderOffset()
and it was never referenced.

18 years agofix tests/testNull after storeSwapOut() becaome StoreEntry::swapOut()
wessels [Fri, 20 Apr 2007 12:00:59 +0000 (12:00 +0000)] 
fix tests/testNull after storeSwapOut() becaome StoreEntry::swapOut()

18 years agoFix Squid <-> pinger communication.
wessels [Fri, 20 Apr 2007 03:25:38 +0000 (03:25 +0000)] 
Fix Squid <-> pinger communication.

Somebody thought it would be nice to use a socketpair(), rather than
a UDP socket, for squid-pinger IPC.  But socketpair() messages cannot
be larger than 4096 bytes.  Pinger is sending ~8KB messages back to
Squid, so we must use UDP (or something that supports large messages).

18 years agoFix NULL pointer bug when using netdb and test_reachability.
wessels [Fri, 20 Apr 2007 02:21:34 +0000 (02:21 +0000)] 
Fix NULL pointer bug when using netdb and test_reachability.

The code in icp_v2.cc was not assigning ICP2state->request.  This only
caused a problem when the 'test_reachability' feature was in use.

I changed the contstructors for ICPState, ICP2State, and ICP3State
classes to accept an HttpRequest parameter.

18 years agoAuthor: Tsantilas Christos <chtsanti@users.sourceforge.net>
wessels [Thu, 19 Apr 2007 22:14:53 +0000 (22:14 +0000)] 
Author: Tsantilas Christos <chtsanti@users.sourceforge.net>
Short StoreEntry::swapOut() does not compile when SIZEOF_OFF_T==4

My change to make a StoreEntry::swapOut() method missed a case inside
#ifdef SIZEOF_OFF_T==4.

18 years agoConverted contentLen() to a StoreEntry class method.
wessels [Thu, 19 Apr 2007 05:38:04 +0000 (05:38 +0000)] 
Converted contentLen() to a StoreEntry class method.

18 years agoConverted three store_swapout.cc functions to StoreEntry class methods
wessels [Wed, 18 Apr 2007 05:05:17 +0000 (05:05 +0000)] 
Converted three store_swapout.cc functions to StoreEntry class methods

storeSwapOut() is now StoreEntry::swapOut()
storeSwapOutFileClose() is now StoreEntry::swapOutFileClose()
storeSwapOutAble() is now Storeentry::swapOutAble()

18 years agounit testing fix for tests/testUfs.cc
wessels [Wed, 18 Apr 2007 04:58:18 +0000 (04:58 +0000)] 
unit testing fix for tests/testUfs.cc

note that store_dirs_rebuilding is now initialized to 1 instead of 0

18 years agounit testing fix for tests/testNull.cc
wessels [Wed, 18 Apr 2007 04:39:50 +0000 (04:39 +0000)] 
unit testing fix for tests/testNull.cc

note that store_dirs_rebuilding is now initialized to 1 instead of 0

18 years agoImported updated WCCP v2 draft from the authors
hno [Tue, 17 Apr 2007 15:21:10 +0000 (15:21 +0000)] 
Imported updated WCCP v2 draft from the authors

18 years agoConverted contentLen() to a StoreEntry class method.
wessels [Tue, 17 Apr 2007 12:07:50 +0000 (12:07 +0000)] 
Converted contentLen() to a StoreEntry class method.

18 years agoConverted objectLen() to a StoreEntry class method.
wessels [Tue, 17 Apr 2007 11:40:18 +0000 (11:40 +0000)] 
Converted objectLen() to a StoreEntry class method.

18 years agoBootstrapped
hno [Tue, 17 Apr 2007 07:03:57 +0000 (07:03 +0000)] 
Bootstrapped

18 years agoBootstrapped
hno [Tue, 17 Apr 2007 06:44:16 +0000 (06:44 +0000)] 
Bootstrapped

18 years agoBootstrapped
hno [Tue, 17 Apr 2007 06:10:40 +0000 (06:10 +0000)] 
Bootstrapped

18 years agoRename cache_dir option read-only to no-store
hno [Tue, 17 Apr 2007 04:10:49 +0000 (04:10 +0000)] 
Rename cache_dir option read-only to no-store

The cache_dir read-only flag is a bit confusing. It only stops objects
from getting added to the store, it does not stop old objects from being
deleted. no-store is a more appropriate name for this option.

18 years agoRemoved FtpStateData::rest_att because is not used anywhere
wessels [Tue, 17 Apr 2007 03:49:03 +0000 (03:49 +0000)] 
Removed FtpStateData::rest_att because is not used anywhere

18 years agoAdd source code comments for retry-related functions in forward.cc
wessels [Tue, 17 Apr 2007 00:35:29 +0000 (00:35 +0000)] 
Add source code comments for retry-related functions in forward.cc

We have at least three functions (methods) in forward.cc that come into
play when reforwarding/retrying requests.  My comments attempt to
explain these methods and when they may be called.

18 years agoBug #1935 fix: Do not retry a request after sending [some of] its body.
rousskov [Mon, 16 Apr 2007 23:43:27 +0000 (23:43 +0000)] 
Bug #1935 fix: Do not retry a request after sending [some of] its body.

Replaced forgotten request_flags::body_sent with HttpRequest::bodyNibbled()
that does not need to be manually updated. The BodyPipe changes probably
deleted the code that set request_flags::body_sent.

18 years agoAuthor: Amos Jeffries <squid3@treenet.co.nz>
hno [Mon, 16 Apr 2007 20:12:06 +0000 (20:12 +0000)] 
Author: Amos Jeffries <squid3@treenet.co.nz>

Remove cppunit from the Squid distribution

Packaging of cppunit within the squid sources has caused more trouble
than was solved. Ease of install independently of squid combined with
the apparently widespread use of cppunit as a standard tool we feel
there is no need for it to be included.

Maintainers and source testers will need to have cppunit installed on
their systems or not use "make check".

18 years agoBootstrapped
hno [Mon, 16 Apr 2007 06:10:47 +0000 (06:10 +0000)] 
Bootstrapped

18 years agoConvert Czech/ERR_SHUTTING_DOWN error file from DOS to Unix text format.
serassio [Sun, 15 Apr 2007 21:18:14 +0000 (21:18 +0000)] 
Convert Czech/ERR_SHUTTING_DOWN error file from DOS to Unix text format.

18 years agoConvert Traditional Chinese error files from DOS to Unix text format.
serassio [Sun, 15 Apr 2007 21:15:06 +0000 (21:15 +0000)] 
Convert Traditional Chinese error files from DOS to Unix text format.

18 years agoBootstrapped
serassio [Sun, 15 Apr 2007 20:49:54 +0000 (20:49 +0000)] 
Bootstrapped

18 years agoBug #1630: TPROXY needs porting from 2.6 to 3.x
serassio [Sun, 15 Apr 2007 20:46:11 +0000 (20:46 +0000)] 
Bug #1630: TPROXY needs porting from 2.6 to 3.x

This patch adds Linux TPROXY support to Squid 3 forward
porting 2.6 code. Based on Steven Swilton work.

The changes are verified to not break non-TPROXY use, while the
TPROXY code is still untested.
If there will be issues in the optional TPROXY code we deal with
them as bugs later on.

18 years agoBootstrapped
hno [Sat, 14 Apr 2007 06:10:47 +0000 (06:10 +0000)] 
Bootstrapped

18 years agoAdded 'store_log_tags' cache manager page. It reports counts of tags that
wessels [Sat, 14 Apr 2007 05:12:31 +0000 (05:12 +0000)] 
Added 'store_log_tags' cache manager page.  It reports counts of tags that
appear in store.log.

18 years agoAdded 'service_times' cachemgr page to report service time percentiles
wessels [Sat, 14 Apr 2007 04:46:03 +0000 (04:46 +0000)] 
Added 'service_times' cachemgr page to report service time percentiles
rather than just median values.

18 years agoAdding a perl script that can send HTCP queries
wessels [Sat, 14 Apr 2007 04:03:19 +0000 (04:03 +0000)] 
Adding a perl script that can send HTCP queries

18 years ago- Some test cases were missing AsyncCall.cc source, causing "make check"
rousskov [Fri, 13 Apr 2007 23:26:37 +0000 (23:26 +0000)] 
- Some test cases were missing AsyncCall.cc source, causing "make check"
  failures (patch by Amos Jeffries).

18 years agoThe return value of comm_udp_recvfrom() must be stored into a signed
wessels [Fri, 13 Apr 2007 23:04:00 +0000 (23:04 +0000)] 
The return value of comm_udp_recvfrom() must be stored into a signed
integer, otherwise we cannot check for errors when len < 0.

18 years agoReverted revision 1.442 change that was supposed to fix
rousskov [Fri, 13 Apr 2007 10:52:19 +0000 (10:52 +0000)] 
Reverted revision 1.442 change that was supposed to fix
bug #1837: Segfault on configuration error

It turns out a better fix for the same bug has been already committed
by Duane Wessels:

    1.88      +2 -2      squid3/src/store_rebuild.cc
    1.157     +9 -2      squid3/src/store_dir.cc

    store_dirs_rebuilding should be initialized to 1

    store_dirs_rebuilding is initialized to _1_ as a hack so that
    storeDirWriteCleanLogs() doesn't try to do anything unless _all_
    cache_dirs have been read.  For example, without this hack, Squid
    will try to write clean log files if -kparse fails (becasue it
    calls fatal()).

18 years agoBootstrapped
hno [Fri, 13 Apr 2007 06:10:46 +0000 (06:10 +0000)] 
Bootstrapped

18 years agoBootstrapped after removing --enable-truncate configure option
wessels [Fri, 13 Apr 2007 05:56:51 +0000 (05:56 +0000)] 
Bootstrapped after removing --enable-truncate configure option

18 years agoThe --enable-truncate and USE_TRUNCATE code has been removed.
wessels [Fri, 13 Apr 2007 05:51:55 +0000 (05:51 +0000)] 
The --enable-truncate and USE_TRUNCATE code has been removed.

As discussed in Bug 1371, the truncate feature is dangerous on
async disk I/O storage schemes and more troublesome than any
possible performance benefits.

18 years agoBug #1475: Filedescriptor limit does not need to be hardcoded for kqueue/epoll
hno [Fri, 13 Apr 2007 05:33:01 +0000 (05:33 +0000)] 
Bug #1475: Filedescriptor limit does not need to be hardcoded for kqueue/epoll

Activate the patch again, as Adrian cleaned up unlinkd ages ago.

18 years agofixed cbdata "cookie" assertion. peer_digest was unlocking peer, but did
wessels [Fri, 13 Apr 2007 05:30:09 +0000 (05:30 +0000)] 
fixed cbdata "cookie" assertion.  peer_digest was unlocking peer, but did
not lock it.  The extra unlock caused it to be freed prematurely.

18 years agominor debugging fix. There was newline in <<
wessels [Fri, 13 Apr 2007 05:25:07 +0000 (05:25 +0000)] 
minor debugging fix.   There was newline in <<

18 years agoFixed SEGV during reconfigure due to NULL pointer bug in eventDelete()
wessels [Fri, 13 Apr 2007 03:47:12 +0000 (03:47 +0000)] 
Fixed SEGV during reconfigure due to NULL pointer bug in eventDelete()

Since the cancel method may now delete multiple events (when
arg is NULL) it no longer returns after a deletion and
we have a potential NULL pointer problem.  If we just
deleted the last event in the list then *E is now equal
to NULL.  We need to break here or else we'll get a NULL
pointer dereference in the last clause of the for loop.

18 years agoA fix for the !flags.write_draining assertion. Due to the way diskd
wessels [Fri, 13 Apr 2007 02:36:56 +0000 (02:36 +0000)] 
A fix for the !flags.write_draining assertion.  Due to the way diskd
works, drainWriteQueue() could get called twice in the stack.  If so,
just return when the write_draining flag is set.

18 years agoComment out some debugging messages that are printed before cache_log
wessels [Fri, 13 Apr 2007 01:37:23 +0000 (01:37 +0000)] 
Comment out some debugging messages that are printed before cache_log
is initialized because we see them on stderr for commands like
squid -k reconfigure.

18 years agosolve some strange negative integer to double conversion bug by casting
wessels [Fri, 13 Apr 2007 00:16:24 +0000 (00:16 +0000)] 
solve some strange negative integer to double conversion bug by casting
the first number in the subtraction to a double.

18 years agoFixed disk file leak. UFS-based disk files were not always closed
wessels [Fri, 13 Apr 2007 00:05:20 +0000 (00:05 +0000)] 
Fixed disk file leak.  UFS-based disk files were not always closed
because the storeClose() may be called when an I/O request is pending.
With this fix, UFSStoreState::writeCompleted now calls tryClosing()
if the try_closing flag is set.

18 years agoThis change should fix bug #1829.
rousskov [Thu, 12 Apr 2007 23:56:39 +0000 (23:56 +0000)] 
This change should fix bug #1829.

The DiskdFile::close function calls the DiskdIOStrategy::send function and
consequently the DiskdIOStrategy::SEND function, with shm_offset value of -1.
If the msgsnd in SEND fails, the SharedMemory::put function is called with
offset=-1, triggering an abort.

Patch by Christos Tsantilas. Reviewed by Guido Serassio and Duane Wessels.

18 years agoAdded reporting of swap and memory usage (%used, %free) to cachemgr info
wessels [Thu, 12 Apr 2007 23:00:34 +0000 (23:00 +0000)] 
Added reporting of swap and memory usage (%used, %free) to cachemgr info
page.

18 years agoThis change should fix bug #1837: Segfault on configuration error
rousskov [Thu, 12 Apr 2007 20:51:10 +0000 (20:51 +0000)] 
This change should fix bug #1837: Segfault on configuration error

When quitting on a fatal error, such as a configuration error, Squid may need
to write clean state/log files. Squid uses comm_ routines to do so. Thus, we
must initialize comm_ before such fatal errors are discovered.

Perhaps a better fix would be to avoid writing clean state/log files until
the old ones become dirty?

18 years agoThis change should fix bug #1898: "assertion failed: tunnel.cc:372"
rousskov [Thu, 12 Apr 2007 20:21:50 +0000 (20:21 +0000)] 
This change should fix bug #1898: "assertion failed: tunnel.cc:372"

The assertion fails in SslStateData::Connection::dataSent method which is
called by SslStateData::writeClientDone and SslStateData::writeServerDone
methods.

Both write*Done methods did not check for the comm_err_t flag.

When the SSL side closes the connection after a successful but partial write,
write*Done is called with the len argument equal to the number of written
bytes, which is positive but less than the size of the given data for write,
and the dataSent() assertion "amount == (size_t)len" fails.

Based on Christos Tsantilas' work.

18 years agoThis change should fix bug #1637.
rousskov [Thu, 12 Apr 2007 20:07:10 +0000 (20:07 +0000)] 
This change should fix bug #1637.

Server transactions keep refcounted pointer to FwdState that launched them.
Server transactions use the pointer to call FwdState upon completion or
abnormal termination. If nobody else points to the FwdState object after the
transaction is done, the object gets destroyed, even if there are other
servers to be tried.

To avoid FwdState destruction when selecting the next server, FwdState must
keep a refcounted pointer to self. That pointer should be created before the
server-selection loop and cleared after the loop. Currently, we create the
pointer when FwdState is created (which is earlier than needed) and clear it
in various places (which may be late and is probably buggy).

Based on Christos Tsantilas' work.

18 years agoFix some HttpMsg lock counting bugs in HTCP.
wessels [Thu, 12 Apr 2007 11:03:54 +0000 (11:03 +0000)] 
Fix some HttpMsg lock counting bugs in HTCP.

18 years agobackout an assertion mistakenly added by last commit
wessels [Thu, 12 Apr 2007 04:58:32 +0000 (04:58 +0000)] 
backout an assertion mistakenly added by last commit

18 years agocache.log was being created as root, then would later fail to open
wessels [Thu, 12 Apr 2007 04:57:34 +0000 (04:57 +0000)] 
cache.log was being created as root, then would later fail to open
with 'Permission denied'.  We were calling leave_suid() after parsing
the config, but before calling configDoConfigure().

We must call configDoConfigure() before leave_suid() because
configDoConfigure() is where we turn username strings into
uid values.

18 years agoFixed parsing diskd cache_dir Q1 and Q2 options
wessels [Thu, 12 Apr 2007 03:22:27 +0000 (03:22 +0000)] 
Fixed parsing diskd cache_dir Q1 and Q2 options

UFSSwapDir::getOptionTree() was calling the DiskdIOStrategy::getOptionTree()
method, but was not using its return value.

18 years agoSince I changed the semantics of store_dirs_rebuilding yesterday (to match
wessels [Wed, 11 Apr 2007 01:24:38 +0000 (01:24 +0000)] 
Since I changed the semantics of store_dirs_rebuilding yesterday (to match
how it works in Squid-2 again), I forgot that storeRebuildComplete()
probably wouldn't do any work as long as store_dirs_rebuilding was greater
than zero.  Now it needs to do its work when store_dirs_rebuilding == 1.

18 years ago- Bug #1356: Close open DNS sockets when doing idnsShutdown. Leaving them
rousskov [Tue, 10 Apr 2007 23:42:43 +0000 (23:42 +0000)] 
- Bug #1356: Close open DNS sockets when doing idnsShutdown. Leaving them
  open may result in an idnsVCClosed callback being called when the name
  servers array have been freed by idnsFreeNameservers.
  (based on Christos Tsantilas and Guido Serassio work)

18 years agostore_dirs_rebuilding should be initialized to 1
wessels [Tue, 10 Apr 2007 06:45:10 +0000 (06:45 +0000)] 
store_dirs_rebuilding should be initialized to 1

store_dirs_rebuilding is initialized to _1_ as a hack so that
storeDirWriteCleanLogs() doesn't try to do anything unless _all_
cache_dirs have been read.  For example, without this hack, Squid
will try to write clean log files if -kparse fails (becasue it
calls fatal()).

18 years agoBootstrapped
hno [Sun, 8 Apr 2007 06:10:46 +0000 (06:10 +0000)] 
Bootstrapped

18 years agoForward port of 2.x changes from Duane:
serassio [Sat, 7 Apr 2007 22:29:06 +0000 (22:29 +0000)] 
Forward port of 2.x changes from Duane:

Set errno passed from diskd to squid.

The diskd helper passes errno in responses.  With this patch, errno
is now set in the main squid process after processing a diskd
response.

Initialize unused fields of diomsg in messages from diskd to squid.

Previously, the diskd helper did not initialize the unused fields
of diomsg.  This was annoying when looking at debugging output
and trying to match requests with responses.  This patch initializes
the unused fields.

18 years agoCosmetic fix: added missing newline in WCCPv2 configuration dump.
serassio [Sat, 7 Apr 2007 16:01:50 +0000 (16:01 +0000)] 
Cosmetic fix: added missing newline in WCCPv2 configuration dump.