]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/comm/IoCallback.cc
Removed squid-old.h
[thirdparty/squid.git] / src / comm / IoCallback.cc
index 7d059b1b4b8ce17c970d891ce518d37d11b9fbe1..67b8d039e6a4478c0021a58aacea402d6bbeced6 100644 (file)
@@ -1,10 +1,12 @@
-#include "config.h"
+#include "squid.h"
 #include "ClientInfo.h"
 #include "comm/Connection.h"
 #include "comm/IoCallback.h"
+#include "comm/Loops.h"
 #include "comm/Write.h"
 #include "CommCalls.h"
 #include "fde.h"
+#include "globals.h"
 
 Comm::CbEntry *Comm::iocb_table;
 
@@ -13,11 +15,9 @@ Comm::CallbackTableInit()
 {
     // XXX: convert this to a std::map<> ?
     iocb_table = static_cast<CbEntry*>(xcalloc(Squid_MaxFD, sizeof(CbEntry)));
-    for (int pos = 0; pos < Squid_MaxFD; pos++) {
+    for (int pos = 0; pos < Squid_MaxFD; ++pos) {
         iocb_table[pos].fd = pos;
-//        iocb_table[pos].readcb.fd = pos;
         iocb_table[pos].readcb.type = IOCB_READ;
-//        iocb_table[pos].writecb.fd = pos;
         iocb_table[pos].writecb.type = IOCB_WRITE;
     }
 }
@@ -26,7 +26,7 @@ void
 Comm::CallbackTableDestruct()
 {
     // release any Comm::Connections being held.
-    for (int pos = 0; pos < Squid_MaxFD; pos++) {
+    for (int pos = 0; pos < Squid_MaxFD; ++pos) {
         iocb_table[pos].readcb.conn = NULL;
         iocb_table[pos].writecb.conn = NULL;
     }
@@ -60,7 +60,7 @@ Comm::IoCallback::setCallback(Comm::iocb_type t, AsyncCall::Pointer &cb, char *b
 void
 Comm::IoCallback::selectOrQueueWrite()
 {
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
     // stand in line if there is one
     if (ClientInfo *clientInfo = fd_table[conn->fd].clientInfo) {
         if (clientInfo->writeLimitingActive) {
@@ -71,7 +71,7 @@ Comm::IoCallback::selectOrQueueWrite()
     }
 #endif
 
-    commSetSelect(conn->fd, COMM_SELECT_WRITE, Comm::HandleWrite, this, 0);
+    SetSelect(conn->fd, COMM_SELECT_WRITE, Comm::HandleWrite, this, 0);
 }
 
 void
@@ -96,7 +96,7 @@ Comm::IoCallback::reset()
     }
     xerrno = 0;
 
-#if DELAY_POOLS
+#if USE_DELAY_POOLS
     quotaQueueReserv = 0;
 #endif
 }