The unified diff between revisions [489fd2f2..] and [f4c2c361..] is displayed below. It can also be downloaded as a raw diff.

#
#
# patch "src/client_side.c"
#  from [0db5cc4dce1a7318a44046503b6ddc84c79d20c4]
#    to [229f4ea833118b28f3a6b9cbde3113da04482cb4]
#
# patch "src/pconn.c"
#  from [5f83c46e535d572c2a6d6f55389e635926c3feee]
#    to [8c9ab2458a98fedd3b53d1e42fdef52ea0235e66]
#
# patch "src/protos.h"
#  from [d924404fa81b7d01e6af2836d2ff9e49c5ddabcd]
#    to [80c18c3dcaa60a909ba9b27218c9b69fe92a3a77]
#
============================================================
--- src/client_side.c	0db5cc4dce1a7318a44046503b6ddc84c79d20c4
+++ src/client_side.c	229f4ea833118b28f3a6b9cbde3113da04482cb4
@@ -1033,14 +1033,16 @@ clientInterpretRequestHeaders(clientHttp
 	if (request->range)
 	    request->flags.range = 1;
     }
-    if(http->conn->pinned) {
+    if(http->conn->pinned && (pconnLookup(request->host,request->port,&request->client_addr,request->client_port) != NULL) ) {
+	/* If there is a pconn tied to this client/port, an NTLM auth has
+	   occurred to the server on theis client connection */
 	request->flags.auth = 1;
 	request->flags.pinned = 1;
 	request->flags.must_keepalive = 1;
     }
-    if (httpHeaderHas(req_hdr, HDR_AUTHORIZATION))
+    else if (httpHeaderHas(req_hdr, HDR_AUTHORIZATION))
 	request->flags.auth = 1;
-    if (request->login[0] != '\0')
+    else if (request->login[0] != '\0')
 	request->flags.auth = 1;
     if (httpHeaderHas(req_hdr, HDR_VIA)) {
 	String s = httpHeaderGetList(req_hdr, HDR_VIA);
============================================================
--- src/pconn.c	5f83c46e535d572c2a6d6f55389e635926c3feee
+++ src/pconn.c	8c9ab2458a98fedd3b53d1e42fdef52ea0235e66
@@ -232,10 +232,7 @@ pconnPop(const char *peer, u_short port,
     struct _pconn *p;
     hash_link *hptr;
     int fd = -1;
-    LOCAL_ARRAY(char, key, PCONN_KEYLEN);
-    assert(table != NULL);
-    pconnKey(key, peer, port, client_address, client_port);
-    hptr = hash_lookup(table, key);
+    hptr = pconnLookup( peer, port, client_address, client_port);
     if (hptr != NULL) {
 	p = (struct _pconn *) hptr;
 	assert(p->nfds > 0);
@@ -247,6 +244,15 @@ pconnPop(const char *peer, u_short port,
     return fd;
 }

+hash_link *
+pconnLookup(const char *peer, u_short port, struct in_addr *client_address, u_short client_port)
+{
+    LOCAL_ARRAY(char, key, PCONN_KEYLEN);
+    assert(table != NULL);
+    pconnKey(key, peer, port, client_address, client_port);
+    return hash_lookup(table, key);
+}
+
 void
 pconnHistCount(int what, int i)
 {
============================================================
--- src/protos.h	d924404fa81b7d01e6af2836d2ff9e49c5ddabcd
+++ src/protos.h	80c18c3dcaa60a909ba9b27218c9b69fe92a3a77
@@ -1148,6 +1148,7 @@ extern int pconnPop(const char *peer, u_

 extern void pconnPush(int, const char *peer, u_short port, struct in_addr *client_address, u_short client_port);
 extern int pconnPop(const char *peer, u_short port, struct in_addr *client_address, u_short client_port);
+extern hash_link *pconnLookup(const char *peer, u_short port, struct in_addr *client_address, u_short client_port);
 extern void pconnInit(void);

 extern int asnMatchIp(void *, struct in_addr);