]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: Tsantilas Christos <chtsanti@users.sourceforge.net>
authorhno <>
Sun, 16 Dec 2007 08:42:14 +0000 (08:42 +0000)
committerhno <>
Sun, 16 Dec 2007 08:42:14 +0000 (08:42 +0000)
Fix ICAP compile after the IPv6 merge

Just a small patch to allow ICAP compile and run with the newly added
IPV6 changes.
First tests looks good.

Regards,
Christos

src/ICAP/ICAPModXact.cc
src/ICAP/ICAPXaction.cc
src/client_side_request.cc

index e14f89b9e0cfe47cbc159b096aafff27cebfae7f..2fc9ad7cfb14bcb7acd431e13ef4c4e24f5e19e4 100644 (file)
@@ -900,10 +900,7 @@ bool ICAPModXact::parseHead(HttpMsg *head)
 void ICAPModXact::inheritVirginProperties(HttpRequest &newR, const HttpRequest &oldR) {
 
     newR.client_addr = oldR.client_addr;
-    newR.client_port = oldR.client_port;
-
     newR.my_addr = oldR.my_addr;
-    newR.my_port = oldR.my_port;
 
     // This may be too conservative for the 204 No Content case
     // may eventually need cloneNullAdaptationImmune() for that.
index 545779f36cd2173e190eb0f5b6935019092e2c40..2c72113d782c32700a4353173735b5b6a9fb8f05 100644 (file)
@@ -107,8 +107,10 @@ void ICAPXaction::openConnection()
     if (!TheICAPConfig.reuse_connections)
         disableRetries(); // this will also safely drain pconn pool
 
+    IPAddress client_addr;
+    client_addr.SetAnyAddr();
     // TODO: check whether NULL domain is appropriate here
-    connection = icapPconnPool->pop(s.host.buf(), s.port, NULL, NULL, isRetriable);
+    connection = icapPconnPool->pop(s.host.buf(), s.port, NULL, client_addr, isRetriable);
     if (connection >= 0) {
         debugs(93,3, HERE << "reused pconn FD " << connection);
         connector = &ICAPXaction_noteCommConnected; // make doneAll() false
@@ -123,7 +125,8 @@ void ICAPXaction::openConnection()
 
     disableRetries(); // we only retry pconn failures
 
-    connection = comm_open(SOCK_STREAM, 0, getOutgoingAddr(NULL), 0,
+    IPAddress outgoing(getOutgoingAddr(NULL));
+    connection = comm_open(SOCK_STREAM, 0, outgoing, 
         COMM_NONBLOCKING, s.uri.buf());
 
     if (connection < 0)
@@ -171,9 +174,11 @@ void ICAPXaction::closeConnection()
         }
 
         if (reuseConnection) {
+            IPAddress client_addr;
+            client_addr.SetAnyAddr();
             debugs(93,3, HERE << "pushing pconn" << status());
             commSetTimeout(connection, -1, NULL, NULL);
-            icapPconnPool->push(connection, theService->host.buf(), theService->port, NULL, NULL);
+            icapPconnPool->push(connection, theService->host.buf(), theService->port, NULL, client_addr);
             disableRetries();
         } else {
             debugs(93,3, HERE << "closing pconn" << status());
index 81a5f9be313d92f241595dcb71f121a201ac7a7e..f454a6f8b31503a29562288493740b3dde0ef956 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: client_side_request.cc,v 1.97 2007/12/14 23:11:46 amosjeffries Exp $
+ * $Id: client_side_request.cc,v 1.98 2007/12/16 01:42:14 hno Exp $
  * 
  * DEBUG: section 85    Client-side Request Routines
  * AUTHOR: Robert Collins (Originally Duane Wessels in client_side.c)
@@ -1234,10 +1234,12 @@ ClientHttpRequest::handleIcapFailure(bool bypassable)
     // The original author of the code also wanted to pass an errno to 
     // setReplyToError, but it seems unlikely that the errno reflects the
     // true cause of the error at this point, so I did not pass it.
+    IPAddress noAddr;
+    noAddr.SetNoAddr();
     ConnStateData::Pointer c = getConn();
     repContext->setReplyToError(ERR_ICAP_FAILURE, HTTP_INTERNAL_SERVER_ERROR,
         request->method, NULL,
-        (c != NULL ? &c->peer.sin_addr : &no_addr), request, NULL,
+        (c != NULL ? c->peer : noAddr), request, NULL,
         (c != NULL && c->auth_user_request ?
             c->auth_user_request : request->auth_user_request));