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.
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
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)
}
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());
/*
- * $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)
// 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));