]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Bug 3723: tcp_outgoing_tos/mark broken for CONNECT requests
authorSebastien Wenske <sebastien@wenske.fr>
Sun, 3 Feb 2013 14:06:15 +0000 (07:06 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 3 Feb 2013 14:06:15 +0000 (07:06 -0700)
src/tunnel.cc

index 670194dfaf2f80588a40008a54e3624a811567ac..c91b68fb94c509d060c09178c472ac741166d26e 100644 (file)
@@ -46,6 +46,7 @@
 #include "http.h"
 #include "HttpRequest.h"
 #include "HttpStateFlags.h"
+#include "ip/QosConfig.h"
 #include "MemBuf.h"
 #include "PeerSelectState.h"
 #include "SquidConfig.h"
@@ -580,6 +581,15 @@ tunnelConnectDone(const Comm::ConnectionPointer &conn, comm_err_t status, int xe
         tunnelState->serverDestinations.shift();
         if (status != COMM_TIMEOUT && tunnelState->serverDestinations.size() > 0) {
             /* Try another IP of this destination host */
+
+            if (Ip::Qos::TheConfig.isAclTosActive()) {
+                tunnelState->serverDestinations[0]->tos = GetTosToServer(tunnelState->request);
+            }
+
+#if SO_MARK && USE_LIBCAP
+            tunnelState->serverDestinations[0]->nfmark = GetNfmarkToServer(tunnelState->request);
+#endif
+
             debugs(26, 4, HERE << "retry with : " << tunnelState->serverDestinations[0]);
             AsyncCall::Pointer call = commCbCall(26,3, "tunnelConnectDone", CommConnectCbPtrFun(tunnelConnectDone, tunnelState));
             Comm::ConnOpener *cs = new Comm::ConnOpener(tunnelState->serverDestinations[0], call, Config.Timeout.connect);
@@ -746,6 +756,14 @@ tunnelPeerSelectComplete(Comm::ConnectionList *peer_paths, ErrorState *err, void
     }
     delete err;
 
+    if (Ip::Qos::TheConfig.isAclTosActive()) {
+        tunnelState->serverDestinations[0]->tos = GetTosToServer(tunnelState->request);
+    }
+
+#if SO_MARK && USE_LIBCAP
+    tunnelState->serverDestinations[0]->nfmark = GetNfmarkToServer(tunnelState->request);
+#endif
+
     debugs(26, 3, HERE << "paths=" << peer_paths->size() << ", p[0]={" << (*peer_paths)[0] << "}, serverDest[0]={" <<
            tunnelState->serverDestinations[0] << "}");