]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/DelayId.cc
Source Format Enforcement (#532)
[thirdparty/squid.git] / src / DelayId.cc
index c8eb2b6a827b48d8053846bccdcef8c031607018..c1fd2b8d82c33e1115c9bfa89621b02d0be4595d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1996-2014 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
  *
  * Squid software is distributed under GPLv2+ license and includes
  * contributions from numerous individuals and organizations.
@@ -20,6 +20,7 @@
 #include "DelayId.h"
 #include "DelayPool.h"
 #include "DelayPools.h"
+#include "http/Stream.h"
 #include "HttpRequest.h"
 #include "SquidConfig.h"
 
@@ -63,7 +64,7 @@ DelayId::operator bool() const
 
 /* create a delay Id for a given request */
 DelayId
-DelayId::DelayClient(ClientHttpRequest * http)
+DelayId::DelayClient(ClientHttpRequest * http, HttpReply *reply)
 {
     HttpRequest *r;
     unsigned short pool;
@@ -85,6 +86,10 @@ DelayId::DelayClient(ClientHttpRequest * http)
         }
 
         ACLFilledChecklist ch(DelayPools::delay_data[pool].access, r, NULL);
+        if (reply) {
+            ch.reply = reply;
+            HTTPMSGLOCK(reply);
+        }
 #if FOLLOW_X_FORWARDED_FOR
         if (Config.onoff.delay_pool_uses_indirect_client)
             ch.src_addr = r->indirect_client_addr;
@@ -96,7 +101,7 @@ DelayId::DelayClient(ClientHttpRequest * http)
         if (http->getConn() != NULL)
             ch.conn(http->getConn());
 
-        if (DelayPools::delay_data[pool].theComposite().getRaw() && ch.fastCheck() == ACCESS_ALLOWED) {
+        if (DelayPools::delay_data[pool].theComposite().getRaw() && ch.fastCheck().allowed()) {
 
             DelayId result (pool + 1);
             CompositePoolNode::CompositeSelectionDetails details;