]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/comm/IoCallback.cc
Source Format Enforcement (#763)
[thirdparty/squid.git] / src / comm / IoCallback.cc
index a018953668c41db40c7a21767501b840fd4b0e3a..324688b51660e5c9c411f715cc64ade22524f979 100644 (file)
@@ -1,3 +1,11 @@
+/*
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #include "squid.h"
 #include "ClientInfo.h"
 #include "comm/Connection.h"
@@ -61,13 +69,9 @@ void
 Comm::IoCallback::selectOrQueueWrite()
 {
 #if USE_DELAY_POOLS
-    // stand in line if there is one
-    if (ClientInfo *clientInfo = fd_table[conn->fd].clientInfo) {
-        if (clientInfo->writeLimitingActive) {
-            quotaQueueReserv = clientInfo->quotaEnqueue(conn->fd);
-            clientInfo->kickQuotaQueue();
-            return;
-        }
+    if (BandwidthBucket *bucket = BandwidthBucket::SelectBucket(&fd_table[conn->fd])) {
+        bucket->scheduleWrite(this);
+        return;
     }
 #endif
 
@@ -103,9 +107,9 @@ Comm::IoCallback::reset()
 
 // Schedule the callback call and clear the callback
 void
-Comm::IoCallback::finish(comm_err_t code, int xerrn)
+Comm::IoCallback::finish(Comm::Flag code, int xerrn)
 {
-    debugs(5, 3, HERE << "called for " << conn << " (" << code << ", " << xerrno << ")");
+    debugs(5, 3, "called for " << conn << " (" << code << ", " << xerrn << ")");
     assert(active());
 
     /* free data */
@@ -131,3 +135,4 @@ Comm::IoCallback::finish(comm_err_t code, int xerrn)
     /* Reset for next round. */
     reset();
 }
+