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.
Exit configure if we detect GCC 2.9x on FreeBSD because it causes
a coredump inside the debugs() macro, which uses the stringstream
class.
CVS ----------------------------------------------------------------------
Fixed the following on HP Tru64 and probably on some other 64 bit platforms:
- assert() must test logical expressions, not pointers
- STATUS define conflict in parse.c (snmplib)
- Warnings SMB, fakeauth and MSNT helpers
- Various debug() ==> debugs() changes
- Alpha asm access to CPU profiling info
- timezone should be long, not time_t
- Various clean of ESI code
- assert() definition problem in diskd.cc
Samba-2.X is declared unsupported by the Samba team. Remove the old
winbind helpers to reduce confusion. People wanting winbind integration
really should use Samba-3.X these days.
Forward port from 2.5 of updated Spanish error messages
- Translates errors/Spanish/ERR_INVALID_RESP to Spanish
- Replaces some ISO8859-1 characters by the preferred HTML code (i.e.
"á" for "á").
- Minor typos or style fixes.
- Unifies the gender of "cache".
- Unifies the spelling of "cache" in spanish.
The last two changes deserve an explanation. The word "cache" in the
sense of a "web cache" or "cache memory" has not been formally (i.e. by
the "Real Academia de la Lengua Española" (Royal Academy of the Spanish
Language)) incorporated into spanish, therefore there isn't a sanctioned
spelling of the word. Nevertheless, the word is widely used in spanish,
but with inconsistencies: it is found both as a masculine and femenine
noun (spanish has only two genders, there is no neuter (it) pronoun) and
with at least two spellings. After a brief survey of the web, I set on a
single gender and spelling and fixed those error messages that were
using different ones (by virtue of being translated by different
people).
serassio [Mon, 27 Jun 2005 00:51:20 +0000 (00:51 +0000)]
Bug #1308: squid -k reconfigure internal corruption if the type of a
cache_dir is changed
Failed to detect if the type of an existing cache_dir was changed,
calling the parser function of the new type with the internal data of
the existing one..
This patch detects this and logs to cache.log (and the console) that a
restart is required.
serassio [Fri, 3 Jun 2005 21:24:14 +0000 (21:24 +0000)]
Bug #1244: Squid-3.0 compilation problems with gcc-4.0
This patch fixes inlining optimization problems with gcc4.
For some functions (peerDigestSwapInHeaders(),
peerDigestSwapInCBlock() and peerDigestSwapInMask()) is not
possible any workaround without big changes, so the function
scope must be changed from static to global.
serassio [Fri, 3 Jun 2005 21:00:55 +0000 (21:00 +0000)]
Use PRIu64 ISO C99 Standard printf() macro for 64 bit unsigned int
instead of llu. This allow the correct formatting of 64 bit printf
on some systems like native Windows.
serassio [Fri, 3 Jun 2005 18:59:06 +0000 (18:59 +0000)]
First step of MinGw configure support.
Changes:
- MinGW environment identification
- Windows PSAPI.DLL support
- Support for Windows native port of OpenSSL
- Winsock support detection
- Identification of maximum FDs number
- Windows native resolver identification
serassio [Sun, 29 May 2005 02:01:06 +0000 (02:01 +0000)]
Bug #1305: Double content-length often harmless
There is quite many web servers out there with broken banner engines
forgetting to delete the original content-length after adding the
banner. Currently these are (rightfully) rejected by Squid.
Instead of rejecting we could select the biggest content-length header
found and remove the other. This should fix up these replies while not
allowing for attacks.