From: Wolfgang Breyha Date: Thu, 18 Oct 2012 04:23:10 +0000 (-0600) Subject: Bug 3655: pinning failure breaks NTLM and Negotiate authentication X-Git-Tag: SQUID_3_2_3~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4ea21ef8cc4b8080298fa55ac1585032ff7cf8d;p=thirdparty%2Fsquid.git Bug 3655: pinning failure breaks NTLM and Negotiate authentication Some additional bits for squid-3.2 ensuring that already pinned connections are cleaned up properly before re-pinning. Also that the pointer is not NULL before closing when un-pinning. --- diff --git a/src/client_side.cc b/src/client_side.cc index 9f375368a6..5ef4157701 100644 --- a/src/client_side.cc +++ b/src/client_side.cc @@ -4034,11 +4034,8 @@ ConnStateData::pinConnection(const Comm::ConnectionPointer &pinServer, HttpReque if (Comm::IsConnOpen(pinning.serverConnection)) { if (pinning.serverConnection->fd == pinServer->fd) return; - - unpinConnection(); // clears fields ready for re-use. Prevent close() scheduling our close handler. - pinning.serverConnection->close(); - } else - unpinConnection(); // clears fields ready for re-use. + } + unpinConnection(); // clears fields ready for re-use. Prevent close() scheduling our close handler. pinning.serverConnection = pinServer; pinning.host = xstrdup(request->GetHost()); @@ -4096,7 +4093,8 @@ ConnStateData::unpinConnection() pinning.closeHandler = NULL; } /// also close the server side socket, we should not use it for any future requests... - pinning.serverConnection->close(); + if (Comm::IsConnOpen(pinning.serverConnection)) + pinning.serverConnection->close(); safe_free(pinning.host); /* NOTE: pinning.pinned should be kept. This combined with fd == -1 at the end of a request indicates that the host