Re: cvs commit: squid3/src/ICAP ICAPConfig.cc ICAPConfig.h ....

From: Amos Jeffries <squid3@dont-contact.us>
Date: Sat, 19 May 2007 02:38:58 +1200

Tsantilas Christos wrote:
> Hi Amos,
> The ICAP client does not build with last changes .
>
> First of all add the operator
> const char& SqString::operator [](unsigned int pos) const
> for use with const strings.
>
> More over there are 1-2 conflicts in ICAP/ICAPXaction.cc
>
> I am attaching a patch. Please look on it.
> I did not test if squid3+icap works OK.
> Today at the evening ........
>
> Regards,
> Christos
>

Oh dear I was sure y test build had --enable-icap.
Seems not though, very sorry.

>
> ------------------------------------------------------------------------
>
> Index: SqString.cc
> ===================================================================
> RCS file: /squid/squid3/src/SqString.cc,v
> retrieving revision 1.1
> diff -u -r1.1 SqString.cc
> --- SqString.cc 18 May 2007 06:44:35 -0000 1.1
> +++ SqString.cc 18 May 2007 08:35:43 -0000
> @@ -234,6 +234,14 @@
> append (old.c_str(), old.len_);
> }
>
> +const char&
> +SqString::operator [](unsigned int pos) const
> +{
> + assert(pos < size_ );
> +
> + return buf_[pos];
> +}
> +
> char&
> SqString::operator [](unsigned int pos)
> {

Does ICAP really not build without a const version of the operator[]?
Strangly it does for me. Oh well, adding anyway.

> Index: ICAP/ICAPXaction.cc
> ===================================================================
> RCS file: /squid/squid3/src/ICAP/ICAPXaction.cc,v
> retrieving revision 1.16
> diff -u -r1.16 ICAPXaction.cc
> --- ICAP/ICAPXaction.cc 18 May 2007 06:41:30 -0000 1.16
> +++ ICAP/ICAPXaction.cc 18 May 2007 08:35:46 -0000
<snip>

> @@ -118,14 +118,10 @@
>
> disableRetries(); // we only retry pconn failures
>
> -<<<<<<< ICAPXaction.cc
> if (connection < 0) {
> connection = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL), 0,
> COMM_NONBLOCKING, s.uri.c_str());
> -=======
> - connection = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL), 0,
> - COMM_NONBLOCKING, s.uri.buf());
> ->>>>>>> 1.15
> + }

This change is more of a problem. To me it looks like the latter bit
that you have removed is part of a previous conflict that got overlooked.

ALEX: am I right in thinking the part _after_ the ==== is the new piece
that should be kept after converting to use c_str()?

>
> if (connection < 0)
> dieOnConnectionFailure(); // throws
> @@ -173,12 +169,7 @@
> if (reuseConnection) {
> debugs(93,3, HERE << "pushing pconn" << status());
> commSetTimeout(connection, -1, NULL, NULL);
> -<<<<<<< ICAPXaction.cc
> icapPconnPool->push(connection, theService->host.c_str(), theService->port, NULL, NULL);
> -=======
> - icapPconnPool->push(connection, theService->host.buf(), theService->port, NULL, NULL);
> - disableRetries();
> ->>>>>>> 1.15
> } else {
> debugs(93,3, HERE << "closing pconn" << status());
> // comm_close will clear timeout

Same here as above.

Amos
Received on Fri May 18 2007 - 08:39:22 MDT

This archive was generated by hypermail pre-2.1.9 : Fri Jun 01 2007 - 12:00:08 MDT