Bug #1334: Can't dump core on Linux when started as root
Don't be as strict about verifying the prctl success. Not all kernels
supports this prctl, but the only downside when not supported is that
there won't be core dumps so there is no reason to report this error at
level 0.
Finish turning MemBuf into a full-fledged class. Almost all of the
former standalone functions are now methods of MemBuf class. The next
step may be to merge init() and clean() methods into the constructor
and destructor.
Made HttpMsg::parseFirstLine() a virtual method for parsing the
status and request lines of HTTP requests and responses.
Still need to write HttpRequest::parseFirstLine().
Made httpReplyHdrCacheInit() and httpRequestHdrCacheInit() into virtual
functions of HttpMsg class. Made some old static functions members of
HttpRequest and HttpReply classes so that the new hdrCacheInit() can
be private (protected).
Also fixed a memory leak with HttpHdrCc, which I may or may not have
recently created.
- Cosmetic cleanup of how // is handled within FTP URL-paths
- Clean up use of BASE HREF in ftp listings, mainly in ;type=d format
listings.
- Bug #1253: BASE HREF missing on ftp directory URLs without /
Cosmetic: Accept ftp://anonymous@ as a synonym for anonymous ftp,
not requiring a password to be entered. This is apparently used by
Symantec Live Update.
cosmetic fix: cachemgr memory stats report absurd "high (hrs)"
values for some pools because those pools are constructed before
squid_curtime is set. This patch calls time(NULL) in the
memMeterSyncHWater() macro if squid_curtime is zero.
Some changes related to URL-parsing for upcoming ICAP additions:
- findTrailingHTTPVersion() now has optional 'char *end' arg for
parsing non-terminated buffers. If end defaults to NULL, then
the string must be NULL terminated.
- urlParseMethod() now has optional 'char *end' arg.
- urlParseProtocol() now has optional 'char *end' arg.
- urlParse() now has optional 'HttpRequest *' arg. If non-NULL,
urlParse() does not allocate a new HttpRequest and returns
this passed arg.
There was a fairly significant mem_node leak because (1) nodes were
being removed from the 'nodes' list without also being deleted, and
(2) there was no storeIOWrite callback to decrement the use count.
This patch changes the mem_node use count to a boolean write_pending
flag, adds a memNodeWriteComplete() callback function, and removes
and deletes nodes at the same time. mem_hdr::unlink() was changed
to return boolean to prevent loops in freeDataUpto().
Changes to HTTP request and reply parsing classes, started by Alex,
further hacked by DW. These are forward-ported from ICAP development
on sourceforge.
Alex's original commit message:
- Moved parts common to HttpReply and HttpRequest to HttpMsg. HttpMsg is
needed to be able to pipe HTTP messages using MsgPipe without knowing
whether the message being piped is a request or response. It is also
handy for keeping ICAPXaction mostly independent from the ICAP request
method (and, hence, the primary HTTP message kind). Moving previously
duplicated code to a single location is supposed to be good long-term.
More polishing work is needed (e.g., protocol and protoPrefix need
to be merged and so can be lastmod and last_modified).
- Added reset/parse/pack methods to parse and pack HTTP messages without
knowing their direction/kind. HttpRequest::parse() is not implemented
yet but we have code that should be reusable for that.
DW's additional changes
- HttpRequest didn't really have any parsing methods or state.
Moved the HttpReply parsing methods to HttpMsg and created a
virtual function for parsing the start line (request line or
status line).
- Added full_uri flag to packInto() method because ICAP needs
full URIs in encapsulated requests.
class ClientHttpRequest had a member 'HttpVersion http_ver' which
isn't really needed. It was only used to remember the version
between calling parseHttpRequest() (where it was initially parsed)
and clientProcessRequest() (where it is permanently saved in
HttpRequest).
This patch makes a local 'http_ver' in clientProcessRequest(),
passes its pointer to parseHttpRequest() and then its value to
clientProcessRequest().
Bug #1378: Transparent proxy problem with IP Filter
On NetBSD and maybe others, when using Ipfilter 4.x, opening of the NAT device
fails.
On Solaris the following message can appear in cache.log:
parseHttpRequest: NAT lookup failed: ioctl(SIOCGNATL): (22) Invalid argument
This patch adds the usage of ipfobj structure for IP Filter 4.0alpha27 and later.
Had a coredump where ACLIP::data was NULL. This patch avoids the
NULL pointer dereference, but there might be another bug elsewhere that
allows data to be NULL.
Bug #1380: E-mail sent when cache dies is blocked from many antispam rules
The e-mail sent when the cache dies use as "From:" field the Squid internal
appname "squid".
This "From:" address is invalid for the majority of antispam filters because
doesn't contains a valid domain name.
This patch adds the 'mail_from' directive to squid.conf, allowing to specify the
from e-mail address and change the default to use 'appname@unique_hostname'.
Some changes and new features for MemBuf to make it more class-like
- made sure that cleaning a buffer that has not been initialized yet does
not lead to coredumps (this is similar to deleting a null pointer in C++).
- Added consume() and append*() methods to allow the buffer to be used in a
consumer/producer pipe-like environment.
- Added content() and space() methods as the first step to hide buf and size
members that require consume() method to always shift content to keep a
copyf of buf member valid (in case somebody made a copy of it).
- Noted that spaceSize() logic assumes the buffer does not expand and is
0-terminated. This means that the following does not hold:
max_capacity == contentSize() + spaceSize()
Fortunately, max_capacity is a private member that nobody should be using
outside of MemBuf.cc
0-termination of a MemBuf? Can we make it explicit like string::c_str()?
- added hasContent() method
- Added public terminate() method because some HTTP parsing routines need it,
unfortunately.
- Added potentialSpaceSize() to report how much space can be available
after the buffer is grown to the max. Useful for callers that decide
whether they _will_ have the space to store new data that they can get
from somewhere.
- Use private copy and operator= methods to prevent us from creating a
copy of a MemBuf. MemBuf copies are bad because then two ->buf pointers
point to the same location and its not clear who should free the memory.
- Added a destructor that asserts if someone forgot to free ->buf. Good
for finding memory leaks.
Restriction on not copying MemBufs must be propogated to MemBuf users.
In many cases this means changing "static" MemBufs to pointers.
serassio [Wed, 31 Aug 2005 02:44:00 +0000 (02:44 +0000)]
Bug #1317: SNMP GETNEXT fails if the given OID is outside the Squid MIB
This quick patch fixes the SNMP GETNEXT search when given an OID outside
the Squid MIB. This allows proper integration of Squid into proxy SNMP
agents.
serassio [Mon, 15 Aug 2005 02:44:28 +0000 (02:44 +0000)]
Bug #1374: Solaris 10 SPARC transparent proxy build problem with ipfilter
On Solaris (and may be that on other platforms could be something similar to
this, we should verify), Ipfilter include files use a SOLARIS2 define defined
only in the ipfilter makefile at ipfilter build time.
This patch adds the SOLARIS2 definition into configure.