The unified diff between revisions [29abc3f7..] and [60564a86..] is displayed below. It can also be downloaded as a raw diff.

#
#
# patch "README.swilton"
#  from [8c137bb096fee737ad9bc7aed9fddc4499c0cd48]
#    to [6bba792bbbf688615305d5080416c2eed3136387]
#
# patch "src/client_side.c"
#  from [4b258b7a5b5bedb849df5fd524f799b736235972]
#    to [671e6d455044433ea7cf317f99e7faeb3dadb80f]
#
# patch "src/pconn.c"
#  from [5f83c46e535d572c2a6d6f55389e635926c3feee]
#    to [8c9ab2458a98fedd3b53d1e42fdef52ea0235e66]
#
# patch "src/protos.h"
#  from [d924404fa81b7d01e6af2836d2ff9e49c5ddabcd]
#    to [80c18c3dcaa60a909ba9b27218c9b69fe92a3a77]
#
# patch "src/store_client.c"
#  from [cc5386afc3d70deb0444ef31e4261517c16565cb]
#    to [d961bf8e2ac9cf641164b0dd9c6b5d0cef3688f0]
#
============================================================
--- README.swilton	8c137bb096fee737ad9bc7aed9fddc4499c0cd48
+++ README.swilton	6bba792bbbf688615305d5080416c2eed3136387
@@ -1,10 +1,11 @@ Current plans are to add the following s
 This tree will be used to add extra features to the squid source.  This is based on differences to the net.cacheboy.squid tree.

 Current plans are to add the following support:
-I'd like to look at some form of direct disk I/O for squid
+- I'd like to look at some form of direct disk I/O for squid

 The following cleanup work needs doing:
-wccp2 needs to have a better config interface, and less hard-coded options
+- wccp2 needs to have a better config interface, and less hard-coded options
+- Connection pinning should shut down the server fd when the client disappears

 Currently applied patches are listed below:
 epoll support
============================================================
--- src/client_side.c	4b258b7a5b5bedb849df5fd524f799b736235972
+++ src/client_side.c	671e6d455044433ea7cf317f99e7faeb3dadb80f
@@ -1033,14 +1033,18 @@ clientInterpretRequestHeaders(clientHttp
 	if (request->range)
 	    request->flags.range = 1;
     }
+    /* If any conneciton has been pinned to this client, force keep alive */
     if(http->conn->pinned) {
-	request->flags.auth = 1;
-	request->flags.pinned = 1;
 	request->flags.must_keepalive = 1;
+	/* If this specific host/port has been pinned to this client, flag */
+	if(pconnLookup(request->host,request->port,&request->client_addr,request->client_port)) {
+	    request->flags.auth = 1;
+	    request->flags.pinned = 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);
@@ -1449,7 +1453,11 @@ clientBuildReplyHeader(clientHttpRequest
 		    ||
 		    (strncasecmp(value, "Negotiate", 9) == 0 &&
 			(value[9] == '\0' || value[9] == ' '))) {
-		    httpHeaderPutStr(hdr, HDR_PROXY_SUPPORT, "Session-Based-Authentication");
+
+		    if(!request->flags.accelerated) {
+			    httpHeaderPutStr(hdr, HDR_PROXY_SUPPORT, "Session-Based-Authentication");
+			    httpHeaderPutStr(hdr, HDR_CONNECTION, "Proxy-support");
+		    }
 		    request->flags.pinned=1;
 		    request->flags.must_keepalive = 1;
 		    http->conn->pinned=1;
============================================================
--- 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);
============================================================
--- src/store_client.c	cc5386afc3d70deb0444ef31e4261517c16565cb
+++ src/store_client.c	d961bf8e2ac9cf641164b0dd9c6b5d0cef3688f0
@@ -282,7 +282,7 @@ storeClientCopy3(StoreEntry * e, store_c
 	   memory, re-poll the fd */
 	if ( (EBIT_TEST(e->flags, ENTRY_DEFER_READ)) &&
 		(storeLowestMemReaderOffset(e) == mem->inmem_hi) ) {
-	    debug(20, 1) ("storeClientCopy3: %s - clearing ENTRY_DEFER_READ\n",e->mem_obj->url);
+	    debug(20, 3) ("storeClientCopy3: %s - clearing ENTRY_DEFER_READ\n",e->mem_obj->url);
 	    /* Clear the flag and re-poll the fd */
 	    EBIT_CLR(e->flags, ENTRY_DEFER_READ);
 #if HAVE_EPOLL