Re: [PATCH] Bug #2583 fix: pure virtual method called

2010-08-22 Thread Amos Jeffries

Alex Rousskov wrote:

Bug #2583 fix: pure virtual method called

When a cbdata-protected class holds its own cbdata and has virtual 
toCbdata(), there is a catch22 problem: we need cbdata to know whether 
the pointer to the class object is valid, and we need to dereference 
that pointer to get cbdata.


Added CbcPointer class to hold both a pointer to a potentially freed 
class object and the cbdata pointer protecting that object. Keeping the 
cbdata pointer allows us to test whether the object is still there 
without dereferencing the object pointer.


Use the CbcPointer class to hold safe pointers to AsyncJobs. This 
prevents pure virtual method called failures because we no longer 
dereference freed job pointers.


Removed Initiator parameter from many initiatee constructors. The 
Adaptation::Initiator::initiateAdaptation method now sets the initiator 
of the job. This makes the constructor profile simpler and removes the 
need to propagate Initiator changes through all the [nested] constructors.


Renamed AsyncJob::AsyncStart() to AsyncJob::Start(). I had to change the 
callers code anyway and it was a good opportunity to remove the 
redundant Async.



Special thanks to Stefan Fritsch for updating and testing an earlier 
version of this patch.



---

P.S. The underlying changes have been tested in production but I had to 
polish them before submitting to trunk. Some advanced C++ concepts might 
not compile on old/broken compilers. We will try to remove/change them 
if needed.


P.P.S. This change is required for at least one more bug fix and for the 
the 1xx handling patch.





One problem:

src/base/CbcPointer.h:
 * #include TextException.h needs to be base/TextException.h.
NP: this should be failing on build since -I. is undefined in src/.


The rest is just more polish

Several of the files with added #include entries:

 * For clarity as they grow its useful to keep the #include statements 
alphabetical. The old code remains messy, but no need to mess the nice 
clean new code. :)
 * If this is for order-dependent includes that is a violation of the 
testHeaders dependency guarantee in all src/* .h code.


Ditto for *_SOURCES list in src/base/Makefile.am.

src/CommCalls.h:
 * useless whitespace addition.


Other than that +1.

Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.6
  Beta testers wanted for 3.2.0.1


Build failed in Hudson: 3.HEAD-i386-OpenBSD-4.5 #516

2010-08-22 Thread noc
See http://build.squid-cache.org/job/3.HEAD-i386-OpenBSD-4.5/516/changes

Changes:

[Amos Jeffries squ...@treenet.co.nz] Author: Various Translators
Translations Update auto-save

--
[...truncated 3113 lines...]
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT msntauth.o -MD -MP -MF .deps/msntauth.Tpo -c -o msntauth.o 
../../../../helpers/basic_auth/MSNT/msntauth.c;  then mv -f 
.deps/msntauth.Tpo .deps/msntauth.Po; else rm -f .deps/msntauth.Tpo; exit 
1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT smbdes.o -MD -MP -MF .deps/smbdes.Tpo -c -o smbdes.o 
../../../../helpers/basic_auth/MSNT/smbdes.c;  then mv -f .deps/smbdes.Tpo 
.deps/smbdes.Po; else rm -f .deps/smbdes.Tpo; exit 1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT smbencrypt.o -MD -MP -MF .deps/smbencrypt.Tpo -c -o 
smbencrypt.o ../../../../helpers/basic_auth/MSNT/smbencrypt.c;  then mv -f 
.deps/smbencrypt.Tpo .deps/smbencrypt.Po; else rm -f 
.deps/smbencrypt.Tpo; exit 1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT smblib-util.o -MD -MP -MF .deps/smblib-util.Tpo -c -o 
smblib-util.o ../../../../helpers/basic_auth/MSNT/smblib-util.c;  then mv -f 
.deps/smblib-util.Tpo .deps/smblib-util.Po; else rm -f 
.deps/smblib-util.Tpo; exit 1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT smblib.o -MD -MP -MF .deps/smblib.Tpo -c -o smblib.o 
../../../../helpers/basic_auth/MSNT/smblib.c;  then mv -f .deps/smblib.Tpo 
.deps/smblib.Po; else rm -f .deps/smblib.Tpo; exit 1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT valid.o -MD -MP -MF .deps/valid.Tpo -c -o valid.o 
../../../../helpers/basic_auth/MSNT/valid.c;  then mv -f .deps/valid.Tpo 
.deps/valid.Po; else rm -f .deps/valid.Tpo; exit 1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT denyusers.o -MD -MP -MF .deps/denyusers.Tpo -c -o 
denyusers.o ../../../../helpers/basic_auth/MSNT/denyusers.c;  then mv -f 
.deps/denyusers.Tpo .deps/denyusers.Po; else rm -f .deps/denyusers.Tpo; 
exit 1; fi
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  -MT allowusers.o -MD -MP -MF .deps/allowusers.Tpo -c -o 
allowusers.o ../../../../helpers/basic_auth/MSNT/allowusers.c;  then mv -f 
.deps/allowusers.Tpo .deps/allowusers.Po; else rm -f 
.deps/allowusers.Tpo; exit 1; fi
ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror -pipe 
-D_REENTRANT  
-DSYSCONFDIR=\/home/hudson/workspace/3.HEAD-i386-OpenBSD-4.5/btlayer-00-default/squid-3.HEAD-BZR/_inst/etc\
 -c ../../../../helpers/basic_auth/MSNT/confload.c -o confload.o
if ccache gcc -DHAVE_CONFIG_H  -I../../../.. -I../../../../include 
-I../../../../src  -I../../../include -I/usr/local/include   
-I../../../../helpers/basic_auth/MSNT-Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Werror 

Re: [PATCH] Send chunked responses if body size is unknown.

2010-08-22 Thread Amos Jeffries

Alex Rousskov wrote:

Send chunked responses if body size is unknown.

Apply HTTP chunked transfer encoding to the response body if all of the 
following conditions are met:


* client claims HTTP version 1.1 or later support
* response does not have a Content-Length header already
* response does not use multipart/byteranges encoding
* connection is persistent

If we decide to send chunked reply, chunked_reply flag is set. Chunked 
encoding is done in ClientSocketContext::packChunk(). The last-chunk is 
sent only when clientReplyContext complete flag is set.




This feature was requested to make Squid work with HTTP/1.1 clients that 
can handle chunked responses but cannot handle connection closures in 
the middle of a transaction sequence. The earlier version of the patch 
(for Squid v3.1) was tested in production.


N.B. A bug in Squid may result in server-side code not treating 
premature server-side connection termination as an error. That bug 
results in Squid client-side sending a complete chunked response to the 
client instead of omitting the last-chunk to indicate a truncated 
response. Fixing that bug is outside this project scope (but we might 
have a patch for it somewhere, I need to check).




+1.

Though it's worth noting that the logic as given also excludes chunking 
in HTTP 2.0, 3.0, etc


Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.6
  Beta testers wanted for 3.2.0.1


Build failed in Hudson: 3.HEAD-i386-opensolaris #414

2010-08-22 Thread noc
See http://build.squid-cache.org/job/3.HEAD-i386-opensolaris/414/changes

Changes:

[Francesco Chemolli kin...@squid-cache.org] Portability fix. Sometimes 
/bin/true is not, apparently, in /bin

[Francesco Chemolli kin...@squid-cache.org] Fix build issue on FreeBSD: 
printf arguments have to be cast.

[Amos Jeffries squ...@treenet.co.nz] Author: Various Translators
Translations Update auto-save

--
[...truncated 3467 lines...]
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:197:
 error: `::wctob' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:198:
 error: `::wmemcmp' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:199:
 error: `::wmemcpy' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:200:
 error: `::wmemmove' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:201:
 error: `::wmemset' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:202:
 error: `::wprintf' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:203:
 error: `::wscanf' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:223:
 error: `::wcsstr' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 In function `wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:227:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:227:
 error:   initializing argument 1 of `wchar_t* std::wcsstr(wchar_t*, const 
wchar_t*)'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 At global scope:
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:229:
 error: `::wmemchr' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 In function `wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:233:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:233:
 error:   initializing argument 1 of `wchar_t* std::wmemchr(wchar_t*, wchar_t, 
size_t)'
In file included from 
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/ios:46,
 from 
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/ostream:45,
 from ../../../src/ip/Address.h:61,
 from ../../../src/squid.h:171,
 from ../../../src/base/AsyncCallQueue.h:10,
 from ../../../src/base/AsyncCallQueue.cc:9:
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static int std::char_traitswchar_t::compare(const 
wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:324:
 error: `wmemcmp' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:324:
 error: (Each undeclared identifier is reported only once for each function it 
appears in.)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static const wchar_t* 
std::char_traitswchar_t::find(const wchar_t*, size_t, const wchar_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:332:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:332:
 error:   initializing argument 1 of `wchar_t* std::wmemchr(wchar_t*, wchar_t, 
size_t)'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static wchar_t* 
std::char_traitswchar_t::move(wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:336:
 error: `wmemmove' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static wchar_t* 
std::char_traitswchar_t::copy(wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:340:
 error: `wmemcpy' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In 

Hudson build is back to normal: 3.HEAD-amd64-FreeBSD-7.2 #535

2010-08-22 Thread noc
See http://build.squid-cache.org/job/3.HEAD-amd64-FreeBSD-7.2/535/changes




Re: [MERGE] Clean up htcp cache_peer options collapsing them into a single option with arguments

2010-08-22 Thread Amos Jeffries

Henrik Nordstrom wrote:

the list of HTCP mode options had grown a bit too large. Collapse them
all into a single htcp= option taking a list of mode flags.



Updated version of Henriks patch. (why did it not get committed last 
year when approved?)


* parser bug fixed to handle a list of exactly one parameter without 
trailing comma (which the original would call bungled).


* special parse case for htcp-oldsquid fully combined with new parser.

* alters the cachemgr config dump to show the new syntax.

Other than parse no operational changes. Fully backward-compatible and 
tested.


Amos
--
Please be using
  Current Stable Squid 2.7.STABLE9 or 3.1.6
  Beta testers wanted for 3.2.0.1
=== modified file 'doc/release-notes/release-3.2.sgml'
--- doc/release-notes/release-3.2.sgml	2010-08-02 13:55:59 +
+++ doc/release-notes/release-3.2.sgml	2010-08-22 11:38:01 +
@@ -373,6 +373,10 @@
 	   emconcurrency=N/em previously called emauth_param ... concurrency/em as a separate option.
 	pRemoved Basic, Digest, NTLM, Negotiate emauth_param ... concurrency/em setting option.
 
+	tagcache_peer/tag
+	pemhtcp-*/em options collapsed into emhtcp=/em taking an optional comma-separated list of flags.
+	   The old form is deprecated but still accepted.
+
 	tagdeny_info/tag
 	pSupport URL format tags. For dynamically generated URL in denial redirect.
 

=== modified file 'src/cache_cf.cc'
--- src/cache_cf.cc	2010-08-15 00:12:43 +
+++ src/cache_cf.cc	2010-08-22 13:06:51 +
@@ -1908,30 +1908,38 @@
 } else if (!strcasecmp(token, weighted-round-robin)) {
 p-options.weighted_roundrobin = 1;
 #if USE_HTCP
-
 } else if (!strcasecmp(token, htcp)) {
 p-options.htcp = 1;
-} else if (!strcasecmp(token, htcp-oldsquid)) {
-p-options.htcp = 1;
-p-options.htcp_oldsquid = 1;
-} else if (!strcasecmp(token, htcp-no-clr)) {
-if (p-options.htcp_only_clr)
-fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
-p-options.htcp = 1;
-p-options.htcp_no_clr = 1;
-} else if (!strcasecmp(token, htcp-no-purge-clr)) {
-p-options.htcp = 1;
-p-options.htcp_no_purge_clr = 1;
-} else if (!strcasecmp(token, htcp-only-clr)) {
-if (p-options.htcp_no_clr)
-fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
-p-options.htcp = 1;
-p-options.htcp_only_clr = 1;
-} else if (!strcasecmp(token, htcp-forward-clr)) {
-p-options.htcp = 1;
-p-options.htcp_forward_clr = 1;
+} else if (!strncasecmp(token, htcp=, 5) || !strncasecmp(token, htcp-, 5)) {
+/* Note: The htcp- form is deprecated, replaced by htcp= */
+p-options.htcp = 1;
+char *tmp = xstrdup(token+5);
+char *mode, *nextmode;
+for (mode = nextmode = tmp; mode; mode = nextmode) {
+nextmode = strchr(mode, ',');
+		debugs(0,0,HTCP mode '  mode  ' next=  nextmode);
+if (nextmode)
+*nextmode++ = '\0';
+if (!strcasecmp(mode, no-clr)) {
+if (p-options.htcp_only_clr)
+fatalf(parse_peer: can't set htcp-no-clr and htcp-only-clr simultaneously);
+p-options.htcp_no_clr = 1;
+} else if (!strcasecmp(mode, no-purge-clr)) {
+p-options.htcp_no_purge_clr = 1;
+} else if (!strcasecmp(mode, only-clr)) {
+if (p-options.htcp_no_clr)
+fatalf(parse_peer: can't set htcp no-clr and only-clr simultaneously);
+p-options.htcp_only_clr = 1;
+} else if (!strcasecmp(mode, forward-clr)) {
+p-options.htcp_forward_clr = 1;
+} else if (!strcasecmp(mode, oldsquid)) {
+p-options.htcp_oldsquid = 1;
+} else {
+fatalf(invalid HTCP mode '%s', mode);
+}
+}
+safe_free(tmp);
 #endif
-
 } else if (!strcasecmp(token, no-netdb-exchange)) {
 p-options.no_netdb_exchange = 1;
 

=== modified file 'src/cf.data.pre'
--- src/cf.data.pre	2010-08-14 16:38:27 +
+++ src/cf.data.pre	2010-08-22 11:28:25 +
@@ -1053,7 +1053,7 @@
 
 	NOTE: The default if no htcp_access lines are present is to
 	deny all traffic. This default may cause problems with peers
-	using the htcp or htcp-oldsquid options.
+	using the htcp option.
 
 	This clause only supports fast acl types.
 	See http://wiki.squid-cache.org/SquidFaq/SquidAcl for details.
@@ -1904,22 +1904,23 @@
 	
 	htcp		Send HTCP, instead of ICP, queries to the neighbor.
 			You probably also want to set the icp-port to 4827
-			instead of 3130.
-	
-	htcp-oldsquid	Send HTCP to old Squid versions.
-	
-	htcp-no-clr	Send HTCP to the neighbor 

Re: [MERGE] Initial netfilter mark patch for comment

2010-08-22 Thread Alex Rousskov

On 08/21/2010 05:45 PM, Henrik Nordström wrote:

lör 2010-08-21 klockan 23:41 +0100 skrev Andrew Beverley:


I have documented all the functions and class data members. Could you
clarify whether *every* variable should be documented with doxygen
comments (including short-lived temporary ones within functions), or
just those that are part of classes/structs?


classes/structs.

temporary variables if their use may not be obvious to someone else
reading your code, but preferably code in such shape that variable use
is obvious.


For example, should 'tos' in the function below have doxygen comments?


No need for that imho.


Agreed. Especially true if you select meaningful names for local 
variables (e.g., headerBuf instead of b or ipCount instead of c).



BTW, if the documentation comment simply spells out the variable name, 
it is worse than no comment. For example,


private:
int isFoo; /// whether we are Foo

is useless but something like

int isFoo; /// caller expects Bar in the result

may shed more light than the variable name itself. Perhaps my 
foo/bar-based example is too abstract to make sense, but try to explain 
what the variable/function does to a person who could not guess it 
correctly from the name alone or, if the name is really obvious/clear, 
supply additional information instead of repeating (spelling out) the name.



Also, there is no requirement to document API implementation methods in 
kids unless you want to:


/// such and such API
class Parent {
/// checks computations results for exceeding INT_MAX
virtual bool willFit() const = 0;
virtual int calc() = 0; /// ...
...
};

/// Foo and bar, using such and such API
class Child: pubic Parent {
...

/* Parent API */
virtual bool willFit() const;
virtual int calc();
...
};

HTH,

Alex.


Hudson build is back to normal: 3.HEAD-i386-OpenBSD-4.5 #517

2010-08-22 Thread noc
See http://build.squid-cache.org/job/3.HEAD-i386-OpenBSD-4.5/517/changes




RFC-2640 support in Squid

2010-08-22 Thread Valery Savchuk
Hello!

I've made some changes in src/ftp.cc for partial support of RFC-2640
(Internalization of the FTP).

This issue allows correctly see and use ftp-directories/files with
national characters, if ftp-server supports RFC-2640.

I've tested it with a lot of Russian ftp-servers and it works quite well.

What I have to do to include my changes to project ?

Some additional information:
- base source: squid/3.1.6  (cvsup FreeBSD usr/ports/www/squid31)
- work platform FreeBSD-8.0R-amd64
- known tested servers:
 gene6 ( http://www.g6ftpserver.com )
 pure-ftpd ( www.pureftpd.org )
- browser FireFox 3.6.8 (russian)

List of changed files:
src/ftp.cc
lib/html_quote.c
include/util.h

Best regards,
Valery Savchuk


Re: RFC-2640 support in Squid

2010-08-22 Thread Henrik Nordström
tis 2010-08-17 klockan 17:55 +0400 skrev Valery Savchuk:

 I've made some changes in src/ftp.cc for partial support of RFC-2640
 (Internalization of the FTP).
 
 This issue allows correctly see and use ftp-directories/files with
 national characters, if ftp-server supports RFC-2640.

Sounds great!

 What I have to do to include my changes to project ?

To get your changes included the first step is to submit them for review
to squid-dev@squid-cache.org, preferably as an unified diff

  diff -ru squid-x.y.z squid-x.y.z-modified

Remember to review your own changes before submitting them, making sure
that the diff only contains the relevant changes and not other unrelated
stuff.

Regards
Henrik



Re: new/delete overloading, why?

2010-08-22 Thread Henrik Nordström
sön 2010-08-22 klockan 17:18 +1200 skrev Amos Jeffries:

 We should add a small compiler unit-test into configure for a while 
 before removing either way. No guess work then.

Do you mean a unit-test to test if the compiler warns about free()
abuses on data allocated by new?

Regards
Henrik



Re: RFC-2640 support in Squid

2010-08-22 Thread Amos Jeffries
On Tue, 17 Aug 2010 17:55:37 +0400, Valery Savchuk
valery.savc...@gmail.com wrote:
 Hello!
 
 I've made some changes in src/ftp.cc for partial support of RFC-2640
 (Internalization of the FTP).
 
 This issue allows correctly see and use ftp-directories/files with
 national characters, if ftp-server supports RFC-2640.
 
 I've tested it with a lot of Russian ftp-servers and it works quite
well.
 
 What I have to do to include my changes to project ?
 
 Some additional information:
 - base source: squid/3.1.6  (cvsup FreeBSD usr/ports/www/squid31)
 - work platform FreeBSD-8.0R-amd64
 - known tested servers:
  gene6 ( http://www.g6ftpserver.com )
  pure-ftpd ( www.pureftpd.org )
 - browser FireFox 3.6.8 (russian)
 
 List of changed files:
 src/ftp.cc
 lib/html_quote.c
 include/util.h
 
 Best regards,
 Valery Savchuk

Thank you very, very much.

One thing to note before going further:
  FTP directory listings are templated for localization starting from 3.2.
Your patch may have different logic requirements in those versions to
output content. Please check that your patch works with a recent 3.HEAD or
3.2.0.1 snapshot.

The full process for getting the patch into a release bundle is outlined
at:
  http://wiki.squid-cache.org/MergeProcedure

With an existing tested patch you are up to the coding style stage.
Checking it meets the guidelines for Squid-3. Please check those basic
syntax details then send the email submission for auditing.


Amos


Build failed in Hudson: 3.HEAD-i386-opensolaris #415

2010-08-22 Thread noc
See http://build.squid-cache.org/job/3.HEAD-i386-opensolaris/415/changes

Changes:

[Amos Jeffries amosjeffr...@squid-cache.org] more prep for 3.1.7

[Amos Jeffries amosjeffr...@squid-cache.org] Author: Stephen Thorne 
step...@thorne.id.au
Bug 3021: Large DNS reply causes crash when no ipv6 resolver present

[Automatic source maintenance squid...@squid-cache.org] SourceFormat 
Enforcement

[Francesco Chemolli kin...@squid-cache.org] Portability fix. Sometimes 
/bin/true is not, apparently, in /bin

--
[...truncated 3468 lines...]
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:187:
 error: `::wcsrtombs' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:197:
 error: `::wctob' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:198:
 error: `::wmemcmp' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:199:
 error: `::wmemcpy' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:200:
 error: `::wmemmove' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:201:
 error: `::wmemset' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:202:
 error: `::wprintf' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:203:
 error: `::wscanf' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:223:
 error: `::wcsstr' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 In function `wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:227:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:227:
 error:   initializing argument 1 of `wchar_t* std::wcsstr(wchar_t*, const 
wchar_t*)'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 At global scope:
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:229:
 error: `::wmemchr' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 In function `wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:233:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:233:
 error:   initializing argument 1 of `wchar_t* std::wmemchr(wchar_t*, wchar_t, 
size_t)'
In file included from 
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/ios:46,
 from 
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/ostream:45,
 from ../../../src/ip/Address.h:61,
 from ../../../src/squid.h:171,
 from ../../../src/base/AsyncCallQueue.h:10,
 from ../../../src/base/AsyncCallQueue.cc:9:
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static int std::char_traitswchar_t::compare(const 
wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:324:
 error: `wmemcmp' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:324:
 error: (Each undeclared identifier is reported only once for each function it 
appears in.)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static const wchar_t* 
std::char_traitswchar_t::find(const wchar_t*, size_t, const wchar_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:332:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:332:
 error:   initializing argument 1 of `wchar_t* std::wmemchr(wchar_t*, wchar_t, 
size_t)'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static wchar_t* 
std::char_traitswchar_t::move(wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:336:
 error: `wmemmove' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static wchar_t* 
std::char_traitswchar_t::copy(wchar_t*, const wchar_t*, size_t)':

Transparent squid + Site Control + Load Balancer

2010-08-22 Thread zae_bdn

First of all, sorry for my english but i'm just a student. I'm working on a
school as a system administrator and they told me if I could control where
the students surf on internet and bond two dsl connections for faster
internet access with low cost. I told that linux is a good option and they
told me what will I need for doing that. They bought me a new desktop
computer with a pair of gigabit ethernet cards. I've installed Ubuntu 9.10
and squid and i want your help for configuring squid in transparent mode,
they should be able to show me where the people connects and should balance
the load of our pair of dsl lines. Can somebody help me. my job is in
danger. Thanks everybody.


Francesc A.
Badalona, Barcelona. Spain
-- 
View this message in context: 
http://squid-web-proxy-cache.1019090.n4.nabble.com/Transparent-squid-Site-Control-Load-Balancer-tp2334552p2334552.html
Sent from the Squid - Development mailing list archive at Nabble.com.


Build failed in Hudson: 3.HEAD-i386-opensolaris #416

2010-08-22 Thread noc
See http://build.squid-cache.org/job/3.HEAD-i386-opensolaris/416/changes

Changes:

[Amos Jeffries amosjeffr...@squid-cache.org] Sync dist languages with .po

[Amos Jeffries amosjeffr...@squid-cache.org] more prep for 3.1.7

--
[...truncated 3488 lines...]
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:176:
 error: `::wcrtomb' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:187:
 error: `::wcsrtombs' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:197:
 error: `::wctob' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:198:
 error: `::wmemcmp' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:199:
 error: `::wmemcpy' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:200:
 error: `::wmemmove' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:201:
 error: `::wmemset' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:202:
 error: `::wprintf' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:203:
 error: `::wscanf' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:223:
 error: `::wcsstr' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 In function `wchar_t* std::wcsstr(wchar_t*, const wchar_t*)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:227:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:227:
 error:   initializing argument 1 of `wchar_t* std::wcsstr(wchar_t*, const 
wchar_t*)'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 At global scope:
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:229:
 error: `::wmemchr' has not been declared
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:
 In function `wchar_t* std::wmemchr(wchar_t*, wchar_t, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:233:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/cwchar:233:
 error:   initializing argument 1 of `wchar_t* std::wmemchr(wchar_t*, wchar_t, 
size_t)'
In file included from 
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/ios:46,
 from 
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/ostream:45,
 from ../../../src/ip/Address.h:61,
 from ../../../src/squid.h:171,
 from ../../../src/base/AsyncCall.cc:5:
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static int std::char_traitswchar_t::compare(const 
wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:324:
 error: `wmemcmp' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:324:
 error: (Each undeclared identifier is reported only once for each function it 
appears in.)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static const wchar_t* 
std::char_traitswchar_t::find(const wchar_t*, size_t, const wchar_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:332:
 error: invalid conversion from `const wchar_t*' to `wchar_t*'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:332:
 error:   initializing argument 1 of `wchar_t* std::wmemchr(wchar_t*, wchar_t, 
size_t)'
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static wchar_t* 
std::char_traitswchar_t::move(wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:336:
 error: `wmemmove' undeclared (first use this function)
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:
 In static member function `static wchar_t* 
std::char_traitswchar_t::copy(wchar_t*, const wchar_t*, size_t)':
/usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/../../../../include/c++/3.4.3/bits/char_traits.h:340:
 error: `wmemcpy' undeclared (first use this function)