[squid-dev] Build failed in Jenkins: 5-matrix » gcc,d-debian-unstable #5

2016-11-11 Thread noc
http://build.squid-cache.org/job/5-matrix/compiler=gcc,label=d-debian-unstable/5/--
[...truncated 32108 lines...]
mv -f $depbase.Tpo $depbase.Plo
depbase=`echo xusleep.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool  --tag=CC   --mode=compile ccache gcc -DHAVE_CONFIG_H   
-I../../.. -I../../../include -I../../../lib -I../../../src -I../include
-I/usr/include/libxml2  -Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow -Werror -pipe 
-D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD -MP -MF $depbase.Tpo -c -o 
xusleep.lo ../../../lib/xusleep.c &&\
mv -f $depbase.Tpo $depbase.Plo
/bin/bash ../libtool  --tag=CC   --mode=link ccache gcc -Wall -Wpointer-arith 
-Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow 
-Werror -pipe -D_REENTRANT -Wall -g -O2  -g -o libmiscencoding.la  base64.lo 
charset.lo html_quote.lo md5.lo rfc1738.lo rfc2617.lo uudecode.lo  
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT util.lo -MD -MP 
-MF .deps/util.Tpo -c ../../../lib/util.c  -fPIC -DPIC -o .libs/util.o
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT 
stub_memaccount.lo -MD -MP -MF .deps/stub_memaccount.Tpo -c 
../../../lib/stub_memaccount.c  -fPIC -DPIC -o .libs/stub_memaccount.o
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT util.lo -MD -MP 
-MF .deps/util.Tpo -c ../../../lib/util.c  -fPIC -DPIC -o util.o >/dev/null 2>&1
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD 
-MP -MF .deps/xusleep.Tpo -c ../../../lib/xusleep.c  -fPIC -DPIC -o 
.libs/xusleep.o
/bin/bash ../libtool  --tag=CXX   --mode=link ccache g++ -I/usr/include/libxml2 
-Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual 
-Werror -Wno-deprecated-register -pipe -D_REENTRANT -I/usr/include/p11-kit-1 -g 
-O2  -g -o libmisccontainers.la  hash.lo  
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT 
stub_memaccount.lo -MD -MP -MF .deps/stub_memaccount.Tpo -c 
../../../lib/stub_memaccount.c  -fPIC -DPIC -o stub_memaccount.o >/dev/null 2>&1
libtool: link: /usr/bin/ar cru .libs/libmiscencoding.a .libs/base64.o 
.libs/charset.o .libs/html_quote.o .libs/md5.o .libs/rfc1738.o .libs/rfc2617.o 
.libs/uudecode.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmiscencoding.a
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD 
-MP -MF .deps/xusleep.Tpo -c ../../../lib/xusleep.c  -fPIC -DPIC -o xusleep.o 
>/dev/null 2>&1
libtool: link: ( cd ".libs" && rm -f "libmiscencoding.la" && ln -s 
"../libmiscencoding.la" "libmiscencoding.la" )
/bin/bash ../libtool  --tag=CXX   --mode=link ccache g++ -I/usr/include/libxml2 
-Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual 
-Werror -Wno-deprecated-register -pipe -D_REENTRANT -I/usr/include/p11-kit-1 -g 
-O2  -g -o libmiscutil.la  getfullhostname.lo heap.lo iso3307.lo radix.lo 
rfc1123.lo Splay.lo stub_memaccount.lo util.lo xusleep.lo  
libtool: link: /usr/bin/ar cru .libs/libmisccontainers.a .libs/hash.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmisccontainers.a
libtool: link: ( cd ".libs" && rm -f "libmisccontainers.la" && ln -s 
"../libmisccontainers.la" "libmisccontainers.la" )
libtool: link: /usr/bin/ar cru .libs/libmiscutil.a .libs/getfullhostname.o 
.libs/heap.o .libs/iso3307.o .libs/radix.o .libs/rfc1123.o .libs/Splay.o 
.libs/stub_memaccount.o .libs/util.o .libs/xusleep.o 

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-11 Thread Alex Rousskov
On 11/11/2016 01:30 AM, Kinkie wrote:
> On Fri, Nov 11, 2016 at 5:02 AM, Amos Jeffries  wrote:
>> On 11/11/2016 9:28 a.m., Kinkie wrote:
>>>
>>> v4 attached.
>>>
>>
>> Does it have to take begin() and end() iterators explicitly?
>>  can we not have it take the container itself and use a for(auto  :
>> container) loop ?
> 
> No it doesn't but it's sometimes convenient.
> My use case is the regex-compressing code. It can be reduced to (pseudocode)
> 
> join(regex-so-far, wordsList., separator=")|(", prefix="(", suffix=")")
> 
> granted, it can be done with explicit append calls but then you can't
> inline it (e.g in streams).
> 
> The code used to take the whole container, but there's a use case for
> iterating over a slice only.

Accepting iterators is standard in STL (despite being slightly
inconvenient) probably because accepting iterators covers a lot more
potential use cases.

Alex.

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] Segfault via Ftp::Client::readControlReply.

2016-11-11 Thread Christos Tsantilas

On 11/11/2016 06:36 PM, Christos Tsantilas wrote:

The patch applied to trunk as r14936 and r14937.


I mean applied to "squid-5".


I am attaching a patch for squid-3.5 release.


On 11/11/2016 07:37 AM, Amos Jeffries wrote:

On 11/11/2016 6:03 a.m., Christos Tsantilas wrote:


Added nil dereference checks for Ftp::Client::ctrl.conn, including:
- Ftp::Client::handlePasvReply() and handleEpsvReply() that dereference
ctrl.conn in DBG_IMPORTANT messages.
- Many functions inside FtpClient.cc and FtpGateway.cc files.

TODO: We need to find a better way to handle nil ctrl.conn. It is only a
matter of time when we forget to add another dereference check or
discover a place we missed during this change.

Also disabled forwarding of EPRT and PORT commands to origin servers.
Squid support for those commands is broken and their forwarding may
cause segfaults (bug #4004). Active FTP is still supported, of course.

This is a Measurement Factory project.



in ftpReadPasv()
- please leave the ftpSendEPRT where it was (but comment out). As-is
this will just add a new Coverity issue about dead/unreachable code.

in completeForwarding()
- sic you are changing the debugs line please polish it all up to remove
the HERE
 - also s/completeForwarding avoids /avoid /

+1 with the above polish.

pPS. please remember to apply on the squid-5 branchnow, not trunk or v4.

Amos

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev


Re: [squid-dev] [PATCH] Segfault via Ftp::Client::readControlReply.

2016-11-11 Thread Christos Tsantilas

The patch applied to trunk as r14936 and r14937.
I am attaching a patch for squid-3.5 release.


On 11/11/2016 07:37 AM, Amos Jeffries wrote:

On 11/11/2016 6:03 a.m., Christos Tsantilas wrote:


Added nil dereference checks for Ftp::Client::ctrl.conn, including:
- Ftp::Client::handlePasvReply() and handleEpsvReply() that dereference
ctrl.conn in DBG_IMPORTANT messages.
- Many functions inside FtpClient.cc and FtpGateway.cc files.

TODO: We need to find a better way to handle nil ctrl.conn. It is only a
matter of time when we forget to add another dereference check or
discover a place we missed during this change.

Also disabled forwarding of EPRT and PORT commands to origin servers.
Squid support for those commands is broken and their forwarding may
cause segfaults (bug #4004). Active FTP is still supported, of course.

This is a Measurement Factory project.



in ftpReadPasv()
- please leave the ftpSendEPRT where it was (but comment out). As-is
this will just add a new Coverity issue about dead/unreachable code.

in completeForwarding()
- sic you are changing the debugs line please polish it all up to remove
the HERE
 - also s/completeForwarding avoids /avoid /

+1 with the above polish.

pPS. please remember to apply on the squid-5 branchnow, not trunk or v4.

Amos

___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev



Segfault via Ftp::Client::readControlReply.

Added nil dereference checks for Ftp::Client::ctrl.conn, including:
- Ftp::Client::handlePasvReply() and handleEpsvReply() that dereference
  ctrl.conn in DBG_IMPORTANT messages.
- Many functions inside FtpClient.cc and FtpGateway.cc files.

TODO: We need to find a better way to handle nil ctrl.conn. It is only
a matter of time when we forget to add another dereference check or
discover a place we missed during this change.

Also disabled forwarding of EPRT and PORT commands to origin servers.
Squid support for those commands is broken and their forwarding may
cause segfaults (bug #4004). Active FTP is still supported, of course.

This is a Measurement Factory project.

=== modified file 'src/clients/FtpClient.cc'
--- src/clients/FtpClient.cc	2016-07-27 09:44:39 +
+++ src/clients/FtpClient.cc	2016-11-11 16:19:47 +
@@ -425,71 +425,81 @@
 if (ctrl.offset == bytes_used) {
 /* used it all up */
 ctrl.offset = 0;
 } else {
 /* Got some data past the complete reply */
 assert(bytes_used < ctrl.offset);
 ctrl.offset -= bytes_used;
 memmove(ctrl.buf, ctrl.buf + bytes_used, ctrl.offset);
 }
 
 debugs(9, 3, "state=" << state << ", code=" << ctrl.replycode);
 }
 
 bool
 Ftp::Client::handlePasvReply(Ip::Address )
 {
 int code = ctrl.replycode;
 char *buf;
 debugs(9, 3, status());
 
+if (!Comm::IsConnOpen(ctrl.conn)) {
+debugs(9, 5, "The control connection to the remote end is closed");
+return false;
+}
+
 if (code != 227) {
 debugs(9, 2, "PASV not supported by remote end");
 return false;
 }
 
 /*  227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).  */
 /*  ANSI sez [^0-9] is undefined, it breaks on Watcom cc */
 debugs(9, 5, "scanning: " << ctrl.last_reply);
 
 buf = ctrl.last_reply + strcspn(ctrl.last_reply, "0123456789");
 
 const char *forceIp = Config.Ftp.sanitycheck ?
   fd_table[ctrl.conn->fd].ipaddr : NULL;
 if (!Ftp::ParseIpPort(buf, forceIp, srvAddr)) {
 debugs(9, DBG_IMPORTANT, "Unsafe PASV reply from " <<
ctrl.conn->remote << ": " << ctrl.last_reply);
 return false;
 }
 
 data.addr(srvAddr);
 
 return true;
 }
 
 bool
 Ftp::Client::handleEpsvReply(Ip::Address )
 {
 int code = ctrl.replycode;
 char *buf;
 debugs(9, 3, status());
 
+if (!Comm::IsConnOpen(ctrl.conn)) {
+debugs(9, 5, "The control connection to the remote end is closed");
+return false;
+}
+
 if (code != 229 && code != 522) {
 if (code == 200) {
 /* handle broken servers (RFC 2428 says OK code for EPSV MUST be 229 not 200) */
 /* vsftpd for one send '200 EPSV ALL ok.' without even port info.
  * Its okay to re-send EPSV 1/2 but nothing else. */
 debugs(9, DBG_IMPORTANT, "Broken FTP Server at " << ctrl.conn->remote << ". Wrong accept code for EPSV");
 } else {
 debugs(9, 2, "EPSV not supported by remote end");
 }
 return sendPassive();
 }
 
 if (code == 522) {
 /* Peer responded with a list of supported methods:
  *   522 Network protocol not supported, use (1)
  *   522 Network protocol not supported, use (1,2)
  *   522 Network protocol not supported, use (2)
  * TODO: Handle the (1,2) case which may happen after EPSV ALL. Close
  * data + control without self-destructing and 

[squid-dev] Build failed in Jenkins: 4-matrix » gcc,d-debian-unstable #3

2016-11-11 Thread noc
http://build.squid-cache.org/job/4-matrix/compiler=gcc,label=d-debian-unstable/3/--
[...truncated 32111 lines...]
libtool: compile:  ccache g++ -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 
-I/usr/include/libxml2 -Wall -Wpointer-arith -Wwrite-strings -Wcomments 
-Wshadow -Woverloaded-virtual -Werror -Wno-deprecated-register -pipe 
-D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 -MT Splay.lo -MD -MP -MF 
.deps/Splay.Tpo -c ../../../lib/Splay.cc  -fPIC -DPIC -o .libs/Splay.o
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT 
stub_memaccount.lo -MD -MP -MF .deps/stub_memaccount.Tpo -c 
../../../lib/stub_memaccount.c  -fPIC -DPIC -o stub_memaccount.o >/dev/null 2>&1
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT util.lo -MD -MP 
-MF .deps/util.Tpo -c ../../../lib/util.c  -fPIC -DPIC -o .libs/util.o
depbase=`echo xusleep.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool  --tag=CC   --mode=compile ccache gcc -DHAVE_CONFIG_H   
-I../../.. -I../../../include -I../../../lib -I../../../src -I../include
-I/usr/include/libxml2  -Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow -Werror -pipe 
-D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD -MP -MF $depbase.Tpo -c -o 
xusleep.lo ../../../lib/xusleep.c &&\
mv -f $depbase.Tpo $depbase.Plo
/bin/bash ../libtool  --tag=CC   --mode=link ccache gcc -Wall -Wpointer-arith 
-Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow 
-Werror -pipe -D_REENTRANT -Wall -g -O2  -g -o libmiscencoding.la  base64.lo 
charset.lo html_quote.lo md5.lo rfc1738.lo rfc2617.lo uudecode.lo  
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT util.lo -MD -MP 
-MF .deps/util.Tpo -c ../../../lib/util.c  -fPIC -DPIC -o util.o >/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=link ccache g++ -I/usr/include/libxml2 
-Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual 
-Werror -Wno-deprecated-register -pipe -D_REENTRANT -I/usr/include/p11-kit-1 -g 
-O2  -g -o libmisccontainers.la  hash.lo  
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD 
-MP -MF .deps/xusleep.Tpo -c ../../../lib/xusleep.c  -fPIC -DPIC -o 
.libs/xusleep.o
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD 
-MP -MF .deps/xusleep.Tpo -c ../../../lib/xusleep.c  -fPIC -DPIC -o xusleep.o 
>/dev/null 2>&1
libtool: link: /usr/bin/ar cru .libs/libmiscencoding.a .libs/base64.o 
.libs/charset.o .libs/html_quote.o .libs/md5.o .libs/rfc1738.o .libs/rfc2617.o 
.libs/uudecode.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmiscencoding.a
libtool: link: ( cd ".libs" && rm -f "libmiscencoding.la" && ln -s 
"../libmiscencoding.la" "libmiscencoding.la" )
libtool: compile:  ccache g++ -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 
-I/usr/include/libxml2 -Wall -Wpointer-arith -Wwrite-strings -Wcomments 
-Wshadow -Woverloaded-virtual -Werror -Wno-deprecated-register -pipe 
-D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 -MT Splay.lo -MD -MP -MF 
.deps/Splay.Tpo -c ../../../lib/Splay.cc  -fPIC -DPIC -o Splay.o >/dev/null 2>&1
libtool: link: /usr/bin/ar cru .libs/libmisccontainers.a .libs/hash.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmisccontainers.a
/bin/bash ../libtool  --tag=CXX   --mode=link ccache g++ -I/usr/include/libxml2 
-Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual 
-Werror -Wno-deprecated-register -pipe -D_REENTRANT -I/usr/include/p11-kit-1 -g 
-O2  -g -o libmiscutil.la  getfullhostname.lo heap.lo 

[squid-dev] Build failed in Jenkins: 5-matrix » gcc,d-debian-unstable #4

2016-11-11 Thread noc
http://build.squid-cache.org/job/5-matrix/compiler=gcc,label=d-debian-unstable/4/--
[...truncated 32111 lines...]
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT 
stub_memaccount.lo -MD -MP -MF .deps/stub_memaccount.Tpo -c 
../../../lib/stub_memaccount.c  -fPIC -DPIC -o stub_memaccount.o >/dev/null 2>&1
libtool: compile:  ccache g++ -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 
-I/usr/include/libxml2 -Wall -Wpointer-arith -Wwrite-strings -Wcomments 
-Wshadow -Woverloaded-virtual -Werror -Wno-deprecated-register -pipe 
-D_REENTRANT -I/usr/include/p11-kit-1 -g -O2 -MT Splay.lo -MD -MP -MF 
.deps/Splay.Tpo -c ../../../lib/Splay.cc  -fPIC -DPIC -o Splay.o >/dev/null 2>&1
depbase=`echo xusleep.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ../libtool  --tag=CC   --mode=compile ccache gcc -DHAVE_CONFIG_H   
-I../../.. -I../../../include -I../../../lib -I../../../src -I../include
-I/usr/include/libxml2  -Wall -Wpointer-arith -Wwrite-strings 
-Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow -Werror -pipe 
-D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD -MP -MF $depbase.Tpo -c -o 
xusleep.lo ../../../lib/xusleep.c &&\
mv -f $depbase.Tpo $depbase.Plo
/bin/bash ../libtool  --tag=CC   --mode=link ccache gcc -Wall -Wpointer-arith 
-Wwrite-strings -Wmissing-prototypes -Wmissing-declarations -Wcomments -Wshadow 
-Werror -pipe -D_REENTRANT -Wall -g -O2  -g -o libmiscencoding.la  base64.lo 
charset.lo html_quote.lo md5.lo rfc1738.lo rfc2617.lo uudecode.lo  
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT util.lo -MD -MP 
-MF .deps/util.Tpo -c ../../../lib/util.c  -fPIC -DPIC -o .libs/util.o
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT radix.lo -MD 
-MP -MF .deps/radix.Tpo -c ../../../lib/radix.c  -fPIC -DPIC -o radix.o 
>/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=link ccache g++ -I/usr/include/libxml2 
-Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual 
-Werror -Wno-deprecated-register -pipe -D_REENTRANT -I/usr/include/p11-kit-1 -g 
-O2  -g -o libmisccontainers.la  hash.lo  
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT util.lo -MD -MP 
-MF .deps/util.Tpo -c ../../../lib/util.c  -fPIC -DPIC -o util.o >/dev/null 2>&1
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD 
-MP -MF .deps/xusleep.Tpo -c ../../../lib/xusleep.c  -fPIC -DPIC -o 
.libs/xusleep.o
libtool: compile:  ccache gcc -DHAVE_CONFIG_H -I../../.. -I../../../include 
-I../../../lib -I../../../src -I../include -I/usr/include/libxml2 -Wall 
-Wpointer-arith -Wwrite-strings -Wmissing-prototypes -Wmissing-declarations 
-Wcomments -Wshadow -Werror -pipe -D_REENTRANT -Wall -g -O2 -MT xusleep.lo -MD 
-MP -MF .deps/xusleep.Tpo -c ../../../lib/xusleep.c  -fPIC -DPIC -o xusleep.o 
>/dev/null 2>&1
/bin/bash ../libtool  --tag=CXX   --mode=link ccache g++ -I/usr/include/libxml2 
-Wall -Wpointer-arith -Wwrite-strings -Wcomments -Wshadow -Woverloaded-virtual 
-Werror -Wno-deprecated-register -pipe -D_REENTRANT -I/usr/include/p11-kit-1 -g 
-O2  -g -o libmiscutil.la  getfullhostname.lo heap.lo iso3307.lo radix.lo 
rfc1123.lo Splay.lo stub_memaccount.lo util.lo xusleep.lo  
libtool: link: /usr/bin/ar cru .libs/libmiscencoding.a .libs/base64.o 
.libs/charset.o .libs/html_quote.o .libs/md5.o .libs/rfc1738.o .libs/rfc2617.o 
.libs/uudecode.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')
libtool: link: ranlib .libs/libmiscencoding.a
libtool: link: ( cd ".libs" && rm -f "libmiscencoding.la" && ln -s 
"../libmiscencoding.la" "libmiscencoding.la" )
libtool: link: /usr/bin/ar cru .libs/libmisccontainers.a .libs/hash.o 
/usr/bin/ar: `u' modifier ignored since `D' is the default (see `U')

Re: [squid-dev] [PATCH] Extend SBufContainerJoin to have prefix and suffix arguments

2016-11-11 Thread Kinkie
On Fri, Nov 11, 2016 at 5:02 AM, Amos Jeffries  wrote:
> On 11/11/2016 9:28 a.m., Kinkie wrote:
>>
>> v4 attached.
>>
>
> Does it have to take begin() and end() iterators explicitly?
>  can we not have it take the container itself and use a for(auto  :
> container) loop ?

No it doesn't but it's sometimes convenient.
My use case is the regex-compressing code. It can be reduced to (pseudocode)

join(regex-so-far, wordsList., separator=")|(", prefix="(", suffix=")")

granted, it can be done with explicit append calls but then you can't
inline it (e.g in streams).

The code used to take the whole container, but there's a use case for
iterating over a slice only.

-- 
Francesco
___
squid-dev mailing list
squid-dev@lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-dev