]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
16 years agoMerged from trunk.
Alex Rousskov [Sat, 27 Sep 2008 18:33:49 +0000 (12:33 -0600)] 
Merged from trunk.

16 years agoSummary: Synced with libecap, adopted pass-all-changes-through transactions
Alex Rousskov [Sat, 27 Sep 2008 18:28:58 +0000 (12:28 -0600)] 
Summary: Synced with libecap, adopted pass-all-changes-through transactions
model.  Polished. Needs more work.

16 years agostillProducing and stillConsuming do not modify their arguments.
Alex Rousskov [Sat, 27 Sep 2008 18:19:22 +0000 (12:19 -0600)] 
stillProducing and stillConsuming do not modify their arguments.

16 years agoUse message representatives to store virgin and adapted messages.
Alex Rousskov [Sat, 27 Sep 2008 18:17:22 +0000 (12:17 -0600)] 
Use message representatives to store virgin and adapted messages.

Migrating to a model where all message changes are done via transaction,
not the message itself. A message cannot handle many changes on its own
because it is not a job, and placing some changes in MessageRep and some
in XactionRep results in messy code.

Polished body handling. Needs more work.

Added satus reporting. Needs more work.

16 years agoSynced with libecap changes related to FirstLine move to Message.
Alex Rousskov [Sat, 27 Sep 2008 18:12:43 +0000 (12:12 -0600)] 
Synced with libecap changes related to FirstLine move to Message.

Migrating to a model where all message changes are done via transaction,
not the message itself. A message cannot handle many changes on its own
because it is not a job, and placing some changes in MessageRep and some
in XactionRep results in messy code.

16 years agoCall parent's status() until we have our own.
Alex Rousskov [Sat, 27 Sep 2008 18:09:04 +0000 (12:09 -0600)] 
Call parent's status() until we have our own.

16 years agoPerformance fix: Check half-closed descriptors at most once per second.
Alex Rousskov [Thu, 25 Sep 2008 17:27:58 +0000 (11:27 -0600)] 
Performance fix: Check half-closed descriptors at most once per second.

A few revisions back, comm checked half-closed descriptors once per second,
but the code was buggy. I replaced it with a simpler code that checked each
half-closed descriptor whenever the OS would mark it as ready for reading.
That was a bad idea: The checks wasted a lot of CPU cycles because half-closed
descriptors are usually ready for reading all the time.

This revision resurrects 1 check/sec limit, but hopefully with fewer bugs. In
my limited tests CPU usage seems to be back to normal.

All half-closed descriptors are now stored in TheHalfClosed set. When it is
time to check the corresponding connections, Comm schedules a read for
each descriptor that is not already reading. Conflicts with regular/user
reads are resolved as before -- we silently cancel the internal half-closed
read.

TODO: It is possible that we do not need to read at all and should call
getsockopt() instead to test the connection.

16 years agoAdded a DescriptorSet class to manage an unordered collection of unique
Alex Rousskov [Thu, 25 Sep 2008 17:22:12 +0000 (11:22 -0600)] 
Added a DescriptorSet class to manage an unordered collection of unique
descriptors.

DescriptorSet is used for half-closed descriptor monitoring. It might be
useful for deferred reads as well, but that remains to be seen.

DescriptorSet has O(1) complexity for search, insertion, and deletion. It uses
about 2*sizeof(int)*MaxFD bytes total. Splay tree that used to store
half-closed descriptors previously uses less RAM for small number of
descriptors but has O(log n) complexity. Same for std::set<int>, a potential
DescriptorSet replacement.

16 years agoLanguages: Ukrainian Translation
Amos Jeffries [Thu, 25 Sep 2008 12:28:17 +0000 (00:28 +1200)] 
Languages: Ukrainian Translation

16 years agoAdding initial notes on AsyncCalls and Comm APIs.
Alex Rousskov [Thu, 25 Sep 2008 04:53:22 +0000 (22:53 -0600)] 
Adding initial notes on AsyncCalls and Comm APIs.
More work is needed to integrate source code and the notes.

16 years agoBug 2433: Ftp put gives bad gateway but put is correct
Amos Jeffries [Wed, 24 Sep 2008 13:21:04 +0000 (01:21 +1200)] 
Bug 2433: Ftp put gives bad gateway but put is correct

16 years agoShow request and reply headers new config via cachemgr dump
Amos Jeffries [Wed, 24 Sep 2008 12:19:57 +0000 (00:19 +1200)] 
Show request and reply headers new config via cachemgr dump

16 years agoComment on FTP recovery from data.fd loss
Amos Jeffries [Wed, 24 Sep 2008 11:57:15 +0000 (23:57 +1200)] 
Comment on FTP recovery from data.fd loss

16 years agoMerge HTCP enhancements.
Benno Rice [Wed, 24 Sep 2008 00:35:17 +0000 (10:35 +1000)] 
Merge HTCP enhancements.

Changes include:

- Ability to send HTCP CLR requests when objects are invalidated or purged from
 the cache.
- Config logic to allow the following:
- HTCP peers who ONLY receive CLR messages from us.
- HTCP peers who NEVER receive CLR messages from us.
- HTCP peers who NEVER receive CLR messages from us for PURGE requests.
- HTCP peers who are forwarded CLR messages we receive.

16 years agoMerge build fix.
Benno Rice [Wed, 24 Sep 2008 00:32:17 +0000 (10:32 +1000)] 
Merge build fix.

16 years agoFix build breakage caused by r9216.
Benno Rice [Wed, 24 Sep 2008 00:29:50 +0000 (10:29 +1000)] 
Fix build breakage caused by r9216.

There were a number of problems in r9216:

- Unterminated blocks in if () statements.
- Use of a struct to refer to an enum declared within the struct.
- Use of incorrect enum values after the originals were renamed.
- References to enum values from within the struct without the struct name.

Note that these changes have not been tested, but they do allow the tree to
build again.

16 years agoFix build breakage caused by r9216.
Benno Rice [Wed, 24 Sep 2008 00:26:10 +0000 (10:26 +1000)] 
Fix build breakage caused by r9216.

There were a number of problems in r9216:

- Unterminated blocks in if () statements.
- Use of a struct to refer to an enum declared within the struct.
- Use of incorrect enum values after the originals were renamed.
- References to enum values from within the struct without the struct name.

Note that these changes have not been tested, but they do allow the tree to
build again.

16 years agoMerge from upstream.
Benno Rice [Tue, 23 Sep 2008 23:53:34 +0000 (09:53 +1000)] 
Merge from upstream.

16 years agoBug #2459 workaround: When dns_error_message value is lost, use "lost DNS
Alex Rousskov [Tue, 23 Sep 2008 16:16:28 +0000 (10:16 -0600)] 
Bug #2459 workaround: When dns_error_message value is lost, use "lost DNS
error" text and log at level 1 to inform the administrator about the internal
error.

This temporary hack does not fix the incorrect DNS error value problem, only
the lost one.

16 years agoDo not call connect handler for closing descriptors because the handler
Alex Rousskov [Tue, 23 Sep 2008 15:05:36 +0000 (09:05 -0600)] 
Do not call connect handler for closing descriptors because the handler
is unlikely to do something useful and is likely to hit Comm assertions
when working with a closing descriptor.

AFAIK, after adding close handlers to FtpStateData and peerProbe code,
all code that uses  commConnectStart has a Comm close or I/O handler that
will be called when the descriptor is closing. This should prevent
connecting jobs from getting stuck waiting for the connection callback
to be called.

16 years agoAdded Comm close handler for the data channel of FtpStateData
Alex Rousskov [Tue, 23 Sep 2008 14:49:50 +0000 (08:49 -0600)] 
Added Comm close handler for the data channel of FtpStateData
transaction in preparation for officially dropping connect callbacks for
closing descriptors.

The data channel can be opened and closed a few times and the descriptor
must be kept in sync with the close handler. I factored out the
open/closing code into a simple FtpChannel class. That class is now used
for both FTP control and data channels.

The changes resolve one XXX discussion regarding FTP not having a close
handler for the data channel. On the other hand, adding a second close
handler attached to the same transaction is not a trivial change as the
side-effects of Squid cleanup code are often illusive.

For example, I suspect that FTP cleanup code does not close or even
check the control channel. I added a DBG_IMPORTANT statement to test
whether the control channel remains open. Or should that be an assert()?

I think that only one out of the two callbacks can be dialed because the
close handler executed first will invalidate the transaction object.

16 years agoSource Format: tools
Amos Jeffries [Tue, 23 Sep 2008 14:15:36 +0000 (02:15 +1200)] 
Source Format: tools

16 years agoCleanups: WCCP config
Amos Jeffries [Tue, 23 Sep 2008 14:05:39 +0000 (02:05 +1200)] 
Cleanups: WCCP config

Adds text labels for WCCPv2 methods.
Admin can now use 'gre', 'l1', 'hash', 'mask' in appropriate places
instead of magic numbers.

Magic numbers still supported for backward compatability.

16 years agoMerge from trunk
Amos Jeffries [Tue, 23 Sep 2008 13:57:01 +0000 (01:57 +1200)] 
Merge from trunk

16 years agoLanguage Updates
Amos Jeffries [Tue, 23 Sep 2008 13:35:42 +0000 (01:35 +1200)] 
Language Updates

16 years agoBug 740: allow external acl's to use reply headers in format
Amos Jeffries [Tue, 23 Sep 2008 13:02:32 +0000 (01:02 +1200)] 
Bug 740: allow external acl's to use reply headers in format

Adds a small bit of token syntax to external_acl_type format.

  %>{Header} HTTP request header
  %>{Hdr:member}
   HTTP request header list member
  %>{Hdr:;member}
HTTP request header list member using ; as
   list separator. ; can be any non-alphanumeric
character.

  %<{Header} HTTP reply header
  %<{Hdr:member}
   HTTP reply header list member
  %<{Hdr:;member}
   HTTP reply header list member using ; as
   list separator. ; can be any non-alphanumeric
character.

Basically the < and > are new following the existing meaning of their
direction in other tokens to match request/reply.

Old format of %{} is left as request header but with WARNING (1) level
noise at configure time indicating the new syntax.

16 years agoCorrect TPROXYv4 handling.
Amos Jeffries [Tue, 23 Sep 2008 10:04:23 +0000 (22:04 +1200)] 
Correct TPROXYv4 handling.

Initial design was based on the false assumption that TPROXYv4 worked
like NAT lookups and returned the IPs on IP_TRANSPARENT.
It in fact returns the correct connection IPs on accept(),

This patch makes TPROXYv4 work correctly and spoof client IP. Port needs
to be randomly assigned by the OS to prevent kernel clashes.

Regular traffic is no longer guaranteed when passed in a tproxy marked
port. It may work as expected but no guarantess yet.
Accelerated traffic and NAT intercepted traffic will certainly fail.
As such their flags are marked as mutually exclusive with the tproxy flag.

Multi-Modes will still operate, but only on seperate ports.

16 years agoAddress more comments from Amos.
Benno Rice [Mon, 22 Sep 2008 23:43:29 +0000 (09:43 +1000)] 
Address more comments from Amos.

- Change debug levels in existing code.
- Rename htcpHandle to htcpHandleMsg.

16 years agoMerge from upstream.
Benno Rice [Mon, 22 Sep 2008 23:33:39 +0000 (09:33 +1000)] 
Merge from upstream.

16 years agofix compile errors
Amos Jeffries [Mon, 22 Sep 2008 23:13:20 +0000 (11:13 +1200)] 
fix compile errors

16 years agoMerge from trunk
Amos Jeffries [Mon, 22 Sep 2008 21:56:44 +0000 (09:56 +1200)] 
Merge from trunk

16 years agoSetPort(0) on right address
Amos Jeffries [Mon, 22 Sep 2008 21:55:15 +0000 (09:55 +1200)] 
SetPort(0) on right address

16 years agoLanguages: Swedish Translation
Amos Jeffries [Mon, 22 Sep 2008 12:13:10 +0000 (00:13 +1200)] 
Languages: Swedish Translation

16 years agoCall failed(ERR_FTP_FAILURE, 0) when data channel is closed unexpectidly,
Alex Rousskov [Mon, 22 Sep 2008 05:52:37 +0000 (23:52 -0600)] 
Call failed(ERR_FTP_FAILURE, 0) when data channel is closed unexpectidly,
to force control channel closure. Apparently, FtpStateData does not close
that channel when cleaning up.

Added and polished comments.

16 years agoAdded Comm close handler for the data channel of FtpStateData transaction in
Alex Rousskov [Mon, 22 Sep 2008 05:14:39 +0000 (23:14 -0600)] 
Added Comm close handler for the data channel of FtpStateData transaction in
preparation for officially dropping connect callbacks for closing descriptors.

The data channel can be opened and closed a few times and the descriptor must
be kept in sync with the close handler. I factored out the open/closing code
into a simple FtpChannel class. That class is now used for both FTP control
and data channels.

16 years agoAddress comments from Alex and Amos.
Benno Rice [Mon, 22 Sep 2008 00:53:13 +0000 (10:53 +1000)] 
Address comments from Alex and Amos.

- Add some comments describing various function purposes.
- Remove some debugging debugs that had crept in.
- Use debugs() in preference to debug()().
- Adjust some debug levels.

16 years agoMerge from upstream.
Benno Rice [Mon, 22 Sep 2008 00:41:38 +0000 (10:41 +1000)] 
Merge from upstream.

16 years agoDon't strcmp Config.Log.store if it's NULL in storeLogOpen.
Benno Rice [Mon, 22 Sep 2008 00:39:31 +0000 (10:39 +1000)] 
Don't strcmp Config.Log.store if it's NULL in storeLogOpen.

16 years agoAvoid a potential compare against a NULL pointer in storeLogOpen.
Benno Rice [Mon, 22 Sep 2008 00:37:49 +0000 (10:37 +1000)] 
Avoid a potential compare against a NULL pointer in storeLogOpen.

16 years agoMerge from upstream.
Benno Rice [Mon, 22 Sep 2008 00:04:12 +0000 (10:04 +1000)] 
Merge from upstream.

16 years agoClenup various code to use debugs() insted of debug()()
Amos Jeffries [Sun, 21 Sep 2008 13:35:17 +0000 (01:35 +1200)] 
Clenup various code to use debugs() insted of debug()()

16 years agoContent-Language headers
Amos Jeffries [Sun, 21 Sep 2008 13:07:38 +0000 (01:07 +1200)] 
Content-Language headers

Adds "Content-Language" header properly if the error page language was
negotiated. Hard codes the default templates as 'en', and the squid.conf
value for soft default language of error_default_language was used.

Sets "Vary: Accept-Language" if negotiation is configured to take place.

16 years agoAdded Comm close handler for peer probe to handle closing of a probe
Alex Rousskov [Sun, 21 Sep 2008 05:08:44 +0000 (23:08 -0600)] 
Added Comm close handler for peer probe to handle closing of a probe
descriptor while connect is pending. This was done in preparation for
officially dropping connect callbacks for closing descriptors.

I suspect that the old-code probe would get stuck if the descriptor were
closed during connect. One the other hand, nothing but a shutdown could
close that probe descriptor, I guess.

16 years agosquid.conf cleanup: Update QUICKSTART to match new squid.conf settings
Amos Jeffries [Sat, 20 Sep 2008 10:03:27 +0000 (22:03 +1200)] 
squid.conf cleanup: Update QUICKSTART to match new squid.conf settings

Several settings are no longer necessary, some have changed to optional
and some are now possibly needing attention on first install.

Also, add several recommendations from Squid developers on best practice
for some options.

16 years agosquid.conf cleanup: Modify several squid.conf defaults
Amos Jeffries [Sat, 20 Sep 2008 09:43:40 +0000 (21:43 +1200)] 
squid.conf cleanup: Modify several squid.conf defaults

Following the cleanup of squid.conf to minimal config modifies the
remaining defaults to make their explicit configuration unnecessary.

    icp_port was made a 0 default (for safety?),
        but the port config line left uncommented. fixed that.
        (most won't need it, those who do need to configure it anyway)

    icp_access lines to allow local network now commented out,
        background default 'deny all' untouched.
        (ditto on above reason)

    miss_access default moved from explicit configured, to
        background default. Implicit absent default was documented
        to be same as explicit config default anyway.

    access_log config moved to a background default + documented.
        rather than explicit config only.

    cache_store_log moved to default none + commented out.
        We've been recommending that for a while now anyway.

    request_header_max_size    boosted to 64KB from 20KB.
        HTTP/1.1 needs big headers. I think that should be okay?

    reply_header_max_size    boosted to 64KB from 20KB.
        HTTP/1.1 needs big headers. I think that should be okay?

    cache_dir defaults to no disk cache, memory only cache.

    maximum_object_size_in_memory - boosted to 512KB.
        Update to at least 64KB was needed anyway to match modern web
        traffic. Picked 512KB to maximize HIT with new default cache.

    cache_mem boosted to 256 MB for caching at least 500 objects.

TODO Options remaining to consider for removal:
    hierarchy_stoplist
    coredump_dir

TODO all the default values probably still need to be checked.

16 years agoAllow random outgoing ports and fix reset debugs
Amos Jeffries [Sat, 20 Sep 2008 05:17:55 +0000 (17:17 +1200)] 
Allow random outgoing ports and fix reset debugs

We only need to spoof the address. Set port so OS can randomly assign
a new one for use that will not clash with existing spoofs.

Also fix teh debug message on ResetFD failure to bind so we can see which
FD and which address:port were attempted when it failed.

16 years agoAbort sendMoreData if our socket is being closed to avoid
Alex Rousskov [Sat, 20 Sep 2008 05:00:47 +0000 (23:00 -0600)] 
Abort sendMoreData if our socket is being closed to avoid
comm.cc:2032: "!fd_table[fd].closing()" assertions in comm_write.

The assert happens when sendMoreData is triggered by an event on the other
(server) side.  The server side does not know that client side (or something
else) have decided to close the client socket. The close callback has not been
dialed yet so the client state has not been invalidated and non-async from
Store callbacks can reach it.

A better fix for this would be to convert more store callbacks to AsyncCalls,
but that may have to wait for client_side rewrite.

Also assert that USE_ZPH_QOS code does not use a negative socket descriptor.
The "fd = conn != NULL ? conn->fd : -1" code seems to imply that our
descriptor may be negative. I do not know whether that can actually happen.

This fix was a part of the recent cleanup effort but got lost when I split
the changes into several MERGE requests :-(.

16 years agoBug #2470: Ignore commented and blank lines in acl files
Henrik Nordstrom [Fri, 19 Sep 2008 21:54:43 +0000 (23:54 +0200)] 
Bug #2470: Ignore commented and blank lines in acl files

The refactoring of strtokFile got the logics for when to ignore
blank lines or commented lines wrong, effectively not ignoring anything..

16 years agoDocumented nasty side effects of ipcache_nbgethostbyname.
Alex Rousskov [Fri, 19 Sep 2008 19:59:29 +0000 (13:59 -0600)] 
Documented nasty side effects of ipcache_nbgethostbyname.

16 years agoClosed TODO: AsyncCalls solved the "reentrant commConnectStart" problem;
Alex Rousskov [Fri, 19 Sep 2008 17:26:31 +0000 (11:26 -0600)] 
Closed TODO: AsyncCalls solved the "reentrant commConnectStart" problem;
the warning comments are no longer needed.

16 years agoAdd note about bug 2469 which still needs testing.
Amos Jeffries [Fri, 19 Sep 2008 15:02:23 +0000 (03:02 +1200)] 
Add note about bug 2469 which still needs testing.

16 years agoBug 2421: OpenBSD also hide v6only socket option we need for comm layer
Amos Jeffries [Fri, 19 Sep 2008 15:00:40 +0000 (03:00 +1200)] 
Bug 2421: OpenBSD also hide v6only socket option we need for comm layer

16 years agoAuthor: Luigi Gangitano <luigi@debian.org>
Amos Jeffries [Fri, 19 Sep 2008 10:52:29 +0000 (22:52 +1200)] 
Author: Luigi Gangitano <luigi@debian.org>
Define DEFAULT_CACHEMGR_CONFIG before its first use.

16 years agoResurrected "fde *F" in comm_close_start. I lost it when cleaning up
Alex Rousskov [Fri, 19 Sep 2008 04:12:32 +0000 (22:12 -0600)] 
Resurrected "fde *F" in comm_close_start. I lost it when cleaning up
the code because it was only used inside USE_SSL. Need to build with
more things enabled...

16 years agoAuthor: Francois Cami <fcami@winsoft.fr>
Amos Jeffries [Fri, 19 Sep 2008 03:29:56 +0000 (15:29 +1200)] 
Author: Francois Cami <fcami@winsoft.fr>
Bug 2466: bad links in ./configure due to website changes

16 years agoRestore IPFW lookup function
Amos Jeffries [Thu, 18 Sep 2008 14:05:10 +0000 (02:05 +1200)] 
Restore IPFW lookup function

16 years agoMerge from trunk
Amos Jeffries [Thu, 18 Sep 2008 13:03:43 +0000 (01:03 +1200)] 
Merge from trunk

16 years agoLogic Fix experiment completion.
Amos Jeffries [Thu, 18 Sep 2008 12:57:49 +0000 (00:57 +1200)] 
Logic Fix experiment completion.

 * Requires 'tproxy' option be teh only mode on a given port.
 * Assumes all requests received there are TPROXY intercepted.
   bind() errors may occur if external configuration passes normal
   requests to the tproxy flagged Squid port.
 * Spoofs client IP on all requests received at that port.

Based on new info, TPROXY once set on a port has to be assumed as always
set. There is nothing reasonably possible which Squid can do as a quick
lookup to retrieve the clients destination IP. BUT, the destination IP is
the one given on accept() in all these cases anyway.

This makes Squid handling code much simpler and faster, but also runs the
risk of breakage on non-tproxy requests to the port.

16 years agoAuthor: Hasso Tepper <hasso@estpak.ee>
Amos Jeffries [Thu, 18 Sep 2008 10:14:14 +0000 (22:14 +1200)] 
Author: Hasso Tepper <hasso@estpak.ee>
Bug 2465: Support for DragonFly BSD

16 years agoBug 2391: assertion failed: forward.cc:1209: "(fs->code == HIER_DIRECT) == !fs->_peer"
Amos Jeffries [Thu, 18 Sep 2008 09:46:56 +0000 (21:46 +1200)] 
Bug 2391: assertion failed: forward.cc:1209: "(fs->code == HIER_DIRECT) == !fs->_peer"

assert was wrong.

16 years agoFinish forward-porting HTCP enhancements from squid 2.HEAD.
Benno Rice [Thu, 18 Sep 2008 02:55:19 +0000 (12:55 +1000)] 
Finish forward-porting HTCP enhancements from squid 2.HEAD.

- Fix purgeEntriesByUrl call.
- Add logic needed to send HTCP CLR request.
- Add logic needed to send HTCP CLR requests to all configured neighbors.
- Wire in calls to send CLR requests to neighbors in appropriate places.
- Use a reference to the HttpRequestMethod rather than a pointer.
- Various cleanups.

16 years agoMerge from upstream.
Benno Rice [Thu, 18 Sep 2008 00:31:34 +0000 (10:31 +1000)] 
Merge from upstream.

16 years agodist Indonesian translations
Amos Jeffries [Tue, 16 Sep 2008 13:01:36 +0000 (01:01 +1200)] 
dist Indonesian translations

16 years agoSpanish Translation import completed
Amos Jeffries [Tue, 16 Sep 2008 12:59:44 +0000 (00:59 +1200)] 
Spanish Translation import completed

16 years agoLanguages: Indonesian Translations (start)
Amos Jeffries [Tue, 16 Sep 2008 12:55:52 +0000 (00:55 +1200)] 
Languages: Indonesian Translations (start)

16 years agocompile error
Amos Jeffries [Mon, 15 Sep 2008 16:07:37 +0000 (04:07 +1200)] 
compile error

16 years agomore bits
Amos Jeffries [Mon, 15 Sep 2008 16:03:21 +0000 (04:03 +1200)] 
more bits

16 years agoTPROXY lookup experiment
Amos Jeffries [Mon, 15 Sep 2008 15:58:29 +0000 (03:58 +1200)] 
TPROXY lookup experiment

Plus compile errors.

16 years agoMerge from trunk
Amos Jeffries [Mon, 15 Sep 2008 14:51:57 +0000 (02:51 +1200)] 
Merge from trunk

16 years agoTypo blockign HEAD langpack generation
Amos Jeffries [Mon, 15 Sep 2008 12:38:22 +0000 (06:38 -0600)] 
Typo blockign HEAD langpack generation

16 years agovarious MemBuf documentation
Amos Jeffries [Mon, 15 Sep 2008 07:56:11 +0000 (19:56 +1200)] 
various MemBuf documentation

16 years agoAuthor: Tsantilas Christos <christos@chtsanti.net>
Amos Jeffries [Sun, 14 Sep 2008 13:40:03 +0000 (01:40 +1200)] 
Author: Tsantilas Christos <christos@chtsanti.net>
Source code formatting scripts

formater.pl
    Script to format source files with the astyle utility
    NP: Squid code requires astyle version 1.22 or later

md5checker.sh
    Scritp to validate the formater.pl script did not alter the code
    syntax in any way. All non-whitespace alterations are reported
    as bungled files for manual auditing.

16 years agoBuild Errors
Amos Jeffries [Sun, 14 Sep 2008 10:10:29 +0000 (22:10 +1200)] 
Build Errors

16 years agoAuthor: Christos Tsantilas <chtsanti@users.sourceforge.net>
Amos Jeffries [Sat, 13 Sep 2008 13:43:00 +0000 (01:43 +1200)] 
Author: Christos Tsantilas <chtsanti@users.sourceforge.net>
Bug 2219: pconn status logic errors when getting chunks

The problem here is that chunk-decoding was wrongly using the eof to mark
the last chunk (look at method HttpStateData::decodeAndWriteReplyBody).
The eof used in HttpStateData to mark that the connection probably closed so
another flag must be used to mark that the last chunk received.

This patch uses the HttpStateData::lastChunk flag to mark that the last chunk
received. Maybe the flag should be moved to  http_state_flags struct or a
general flag "complete" should used to mark that the whole body received.

16 years agoBug 2363: Install Error: comparison between signed and unsigned int
Amos Jeffries [Sat, 13 Sep 2008 11:59:49 +0000 (23:59 +1200)] 
Bug 2363: Install Error: comparison between signed and unsigned int

FreeBSD 7 now define FD_SETSIZE as unsigned. However squid needs to compare it
against signed values on occasion. This casts the squid internal FD limit macro
to ensure its signed.

A better fix may be to audit the code and completely change all FD_SET*
handling codepaths to handle and pass values of a custom signedness
as determined by the OS at build time.

16 years agoDebug display alterations
Amos Jeffries [Sat, 13 Sep 2008 01:15:56 +0000 (13:15 +1200)] 
Debug display alterations

Enable on/off for all interception errors. Turn on.

Option to silence all NAT if TPROXY in use

re-order code for sightly faster performance on lookups.

16 years agoIndicate FD when interception tests fail
Amos Jeffries [Sat, 13 Sep 2008 01:00:20 +0000 (13:00 +1200)] 
Indicate FD when interception tests fail

16 years agoCleanup client side URL processing cases
Amos Jeffries [Sat, 13 Sep 2008 00:40:14 +0000 (12:40 +1200)] 
Cleanup client side URL processing cases

prepareTransparentURL() was used in a strange way to catch requests received
on a transparent port but with NAT failures. Corrected the cases documentation
and added TPROXT flags to catch transparent failures.

pass transparency flags properly between client and server sides. include
the spoof client IP flag for TPROXY.

16 years agoMerge from trunk
Amos Jeffries [Sat, 13 Sep 2008 00:25:06 +0000 (12:25 +1200)] 
Merge from trunk

16 years agoBump cache_mem to 256 MB
Amos Jeffries [Fri, 12 Sep 2008 12:43:39 +0000 (00:43 +1200)] 
Bump cache_mem to 256 MB

16 years agoMerge from trunk
Amos Jeffries [Fri, 12 Sep 2008 08:52:35 +0000 (20:52 +1200)] 
Merge from trunk

16 years agoWCCP compile errors
Amos Jeffries [Fri, 12 Sep 2008 08:14:32 +0000 (20:14 +1200)] 
WCCP compile errors

16 years agoAggregate commit after two --local commits:
Alex Rousskov [Fri, 12 Sep 2008 03:57:47 +0000 (21:57 -0600)] 
Aggregate commit after two --local commits:
 - Cleaned up Comm: comm_close, comm_read_cancel, half-closed monitors, leaks.
 - Cleaned up reconfiguration sequence.
Please see individual commit messages for details (bzr permitting).

16 years agoCleaned up reconfiguration sequence.
Alex Rousskov [Fri, 12 Sep 2008 02:59:51 +0000 (20:59 -0600)] 
Cleaned up reconfiguration sequence.

mainReconfigure() used to close and then open various sockets. Since
comm_close is now asynchronous, one cannot close and open in the same
function. Split mainReconfigure into mainReconfigureStart (that starts
the closing process for all relevant sockets) and mainReconfigureFinish
that opens the new sockets.

serverConnectionsClose is only used by main.cc and, hence, can be
static.

Polished comments and added an XXX comment on why SquidShutdown is
broken.

Also removed commCheckHalfClosed event scheduling. A separate cleanup
patch removes the associated half-closed monitoring loop.

16 years agoCleaned up Comm: comm_close, comm_read_cancel, half-closed monitors, leaks.
Alex Rousskov [Fri, 12 Sep 2008 02:58:44 +0000 (20:58 -0600)] 
Cleaned up Comm: comm_close, comm_read_cancel, half-closed monitors, leaks.

1) Comm_close now implements the following API:

  Comm_close does not close the descriptor but initiates the following
  closing sequence:

      1) The descriptor is placed in a "closing" state.
      2) The registered read, write, and accept callbacks (if any) are
         scheduled (in an unspecified order).
      3) The close callbacks are scheduled (in an unspecified order).
      4) A call to the internal descriptor closing handler is
         scheduled.

  Details of the above steps are being documented separately and will
  become a part of Comm API documentation.

  Since all notifications are asynchronous, it is possible for a read or
  write notification that was scheduled before comm_close was called to
  arrive at its destination after comm_close was called.  Such
  notification will arrive with COMM_ERR_CLOSING flag even though that
  flag was not set at the time of the I/O (and the I/O may have been
  successful). CommIoCbParams::syncWithComm is used for this.  The
  credit for this trick goes to Christos Tsantilas.

  Removed fde.flags.closing_ flag as unused.

2) Removed most of the half-closed monitoring code. Old code scheduled
   monitoring reads every main loop iteration, I think. It is possible
   that the assumption was that the handler will be activated and
   cleared once per iteration so that the new read can be scheduled. The
   design could result in conflicts between two monitoring reads and
   possibly between a monitoring read and an active read. There were
   also problems with handling closing descriptors.

   I have removed the loop, AbortChecker, and the associated splay
   tree). When user code marks the descriptor as half-closed, Comm now
   simply schedules a monitoring read callback.  If the user needs to
   check whether the descriptor was marked, Comm checks whether the
   callback is present.  If a user schedules a read when there is
   already a monitoring callback, the monitoring callback is removed.

   Renamed user-facing monitoring functions but left compatibility
   wrappers in place to minimize user code changes, for now.

   It is possible that the whole half-closed monitoring code will be
   eventually deleted. The above changes are meant to preserve the
   intended functionality (but without coredumps) while the decision is
   being made.

3) Removed _SQUID_LINUX_-only code that would avoid addrinfo destruction
   on connect "errors".  Squid seems to be working fine without this
   code. With this code, we leak memory on many connect requests because
   of EINPROGRESS. More work is probably needed to reproduce and fix the
   true cause of the memory corruption observed earlier. Removing the
   workaround will allow us to get more bug reports if the problem is
   still there.

16 years agoCleaned up ConnStateData's closing and destruction.
Alex Rousskov [Fri, 12 Sep 2008 02:52:50 +0000 (20:52 -0600)] 
Cleaned up ConnStateData's closing and destruction.

1) Despite its name and the "if (open) close" use in ConnStateData
destructor, ConnStateData::close() was not closing anything. It was
called from the Comm close handler and from the destructor and would
attempt to immediately delete the ConnStateData object. Protecting code
in deleteThis() may have prevented the actual [double] delete from
happening, but it is difficult to say exactly what was going on when the
close() method was being called from the destructor.

I converted ConnStateData::close to swanSong, which is the standard
AsyncJob cleanup method. As before, the method does not close anything
(which may still be wrong). The swanSong method is never called directly
by the user code. It is called by lower layers just before the job is
destroyed. The updated close handler initiates job destruction by
calling deleteThis().

We may need to add Comm closing code to swanSong. For now, the updated
ConnStateData destructor will warn if ConnStateData forgot to close the
connection. The destructor will also warn if swanSong was not called,
which would mean that the job object is being deleted incorrectly.

2) Polished ClientSocketContext::writeComplete to distinguish
STREAM_UNPLANNED_COMPLETE from STREAM_FAILED closing state. This helps
when looking at stack traces.

3) Added an XXX comment about duplicated code.

4) Documented ClientSocketContext::initiateClose purpose and context.

16 years agoreply and assignment methods are not actually linked
Amos Jeffries [Fri, 12 Sep 2008 01:14:37 +0000 (13:14 +1200)] 
reply and assignment methods are not actually linked

16 years agoCorrect debug messages on error page actions
Amos Jeffries [Thu, 11 Sep 2008 13:00:07 +0000 (01:00 +1200)] 
Correct debug messages on error page actions

16 years agoBug 2454: IPFWInterception getsockname() test is inverted
Amos Jeffries [Thu, 11 Sep 2008 11:19:43 +0000 (23:19 +1200)] 
Bug 2454: IPFWInterception getsockname() test is inverted

16 years agoBug 1628: follow_x_forwarded_for shoudl not cause allow/deny behavior
Amos Jeffries [Thu, 11 Sep 2008 11:14:39 +0000 (23:14 +1200)] 
Bug 1628: follow_x_forwarded_for shoudl not cause allow/deny behavior

clientFollowXForwardedForCheck() needs to always set the
request->indirect_client_addr properly at completion and call
calloutContext->clientAccessCheck(); unconditionally to begin actual
access ACL tests.

Calling clientAccessCheckDone(answer) is equivalent to processing an
http_access line with denial.

16 years agoCleaned up reconfiguration sequence.
Alex Rousskov [Thu, 11 Sep 2008 06:32:57 +0000 (00:32 -0600)] 
Cleaned up reconfiguration sequence.

mainReconfigure() used to close and then open various sockets. Since
comm_close is now asynchronous, one cannot close and open in the same
function. Split mainReconfigure into mainReconfigureStart (that starts
the closing process for all relevant sockets) and mainReconfigureFinish
that opens the new sockets.

serverConnectionsClose is only used by main.cc and, hence, can be static.

Polished comments and added an XXX comment on why SquidShutdown is broken.

Also removed commCheckHalfClosed event scheduling. A separate cleanup patch
removes the associated half-closed monitoring loop.

16 years agoCleaned up Comm: comm_close, comm_read_cancel, half-closed monitors,
Alex Rousskov [Thu, 11 Sep 2008 05:58:32 +0000 (23:58 -0600)] 
Cleaned up Comm: comm_close, comm_read_cancel, half-closed monitors,
leaks.

1) Comm_close now implements the following API:

  Comm_close does not close the descriptor but initiates the following
  closing sequence:

      1) The descriptor is placed in a "closing" state.
      2) The registered read, write, and accept callbacks (if any) are
         scheduled (in an unspecified order).
      3) The close callbacks are scheduled (in an unspecified order).
      4) A call to the internal descriptor closing handler is
         scheduled.

  Details of the above steps are being documented separately and will
  become a part of Comm API documentation.

  Since all notifications are asynchronous, it is possible for a read or
  write notification that was scheduled before comm_close was called to
  arrive at its destination after comm_close was called.  Such
  notification will arrive with COMM_ERR_CLOSING flag even though that
  flag was not set at the time of the I/O (and the I/O may have been
  successful). CommIoCbParams::syncWithComm is used for this.  The
  credit for this trick goes to Christos Tsantilas.

  Removed fde.flags.closing_ flag as unused.

2) Removed most of the half-closed monitoring code. Old code scheduled
   monitoring reads every main loop iteration, I think. It is possible
   that the assumption was that the handler will be activated and
   cleared once per iteration so that the new read can be scheduled. The
   design could result in conflicts between two monitoring reads and
   possibly between a monitoring read and an active read. There were
   also problems with handling closing descriptors.

   I have removed the loop, AbortChecker, and the associated splay
   tree). When user code marks the descriptor as half-closed, Comm now
   simply schedules a monitoring read callback.  If the user needs to
   check whether the descriptor was marked, Comm checks whether the
   callback is present.  If a user schedules a read when there is
   already a monitoring callback, the monitoring callback is removed.

   Renamed user-facing monitoring functions but left compatibility
   wrappers in place to minimize user code changes, for now.

   It is possible that the whole half-closed monitoring code will be
   eventually deleted. The above changes are meant to preserve the
   intended functionality (but without coredumps) while the decision is
   being made.

3) Removed _SQUID_LINUX_-only code that would avoid addrinfo destruction
   on connect "errors".  Squid seems to be working fine without this
   code. With this code, we leak memory on many connect requests because
   of EINPROGRESS. More work is probably needed to reproduce and fix the
   true cause of the memory corruption observed earlier. Removing the
   workaround will allow us to get more bug reports if the problem is
   still there.

16 years agoFix compile errors
Amos Jeffries [Thu, 11 Sep 2008 05:19:13 +0000 (17:19 +1200)] 
Fix compile errors

My braindead alteration to pass the base data and config directories to
the code for use at compile-time backfired with ./configure adding variable
names intended for automake into the autoconf.h file for build.

This approach drops any fancy definition/substitution attempts
and simply adds an compiler flag parameter to every object build.

16 years agoCleaned up ConnStateData's closing and destruction.
Alex Rousskov [Thu, 11 Sep 2008 04:54:34 +0000 (22:54 -0600)] 
Cleaned up ConnStateData's closing and destruction.

1) Despite its name and the "if (open) close" use in ConnStateData destructor,
ConnStateData::close() was not closing anything. It was called from the Comm
close handler and from the destructor and would attempt to immediately delete
the ConnStateData object. Protecting code in deleteThis() may have prevented
the actual [double] delete from happening, but it is difficult to say exactly
what was going on when close() was being called from the destructor.

I converted ConnStateData::close to swanSong, which is the standard AsyncJob
cleanup method. As before, the method does not close anything (which may be
wrong). The swanSong method is never called directly by the user code. It is
called by lower layers just before the job is destroyed.

We may need to add Comm closing code to swanSong. For now, the updated
ConnStateData destructor will warn if ConnStateData forgot to close
the connection. The destructor will also warn if swanSong was not called,
which would mean that the job object is being deleted incorrectly.

2) Polished ClientSocketContext::writeComplete to distinguish
STREAM_UNPLANNED_COMPLETE from STREAM_FAILED closing state. This helps when
looking at stack traces.

3) Added an XXX comment about duplicated code.

4) Documented ClientSocketContext::initiateClose purpose and context.

16 years agoWCCPv2 assignment method overlaps
Amos Jeffries [Wed, 10 Sep 2008 15:47:36 +0000 (03:47 +1200)] 
WCCPv2 assignment method overlaps

16 years agoFriendly WCCPv2 method config
Amos Jeffries [Wed, 10 Sep 2008 15:22:08 +0000 (03:22 +1200)] 
Friendly WCCPv2 method config

16 years agoMerge from trunk
Amos Jeffries [Wed, 10 Sep 2008 15:21:27 +0000 (03:21 +1200)] 
Merge from trunk

16 years agoTestBed: report major errors logged. on completion
Amos Jeffries [Wed, 10 Sep 2008 01:56:34 +0000 (19:56 -0600)] 
TestBed: report major errors logged. on completion

16 years agoSuppress langpack from non-HEAD branches
Amos Jeffries [Wed, 10 Sep 2008 01:54:58 +0000 (19:54 -0600)] 
Suppress langpack from non-HEAD branches

16 years agoDo not erase the announcement port by assigning an accouncement IP address.
Alex Rousskov [Tue, 9 Sep 2008 17:17:33 +0000 (11:17 -0600)] 
Do not erase the announcement port by assigning an accouncement IP address.

With 11(!) assignment operators (not even counting the implicit ones),
no wonder IPAddress assignment semantics gets lost on developers.