]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - src/comm/Loops.h
Source Format Enforcement (#1234)
[thirdparty/squid.git] / src / comm / Loops.h
index d587da9392337ab54ea11e7be86fc851d541bb75..b80cc9127a6be9c0bdaf6719908d138ce8b3574c 100644 (file)
@@ -1,10 +1,17 @@
+/*
+ * Copyright (C) 1996-2023 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.
+ */
+
 #ifndef _SQUID_SRC_COMM_LOOPS_H
 #define _SQUID_SRC_COMM_LOOPS_H
 
-#include "comm_err_t.h"
-
-// for PF
-#include "typedefs.h"
+#include "comm/Flag.h"
+#include "comm/forward.h"
+#include "defines.h"
 
 /* Comm layer select loops API.
  *
@@ -18,16 +25,17 @@ namespace Comm
 /// Initialize the module on Squid startup
 void SelectLoopInit(void);
 
-/// Mark an FD to be watched for its IO status.
-void SetSelect(int, unsigned int, PF *, void *, time_t);
-
 /// reset/undo/unregister the watch for an FD which was set by Comm::SetSelect()
-void ResetSelect(int);
+inline void
+ResetSelect(int fd)
+{
+    SetSelect(fd, COMM_SELECT_READ|COMM_SELECT_WRITE, nullptr, nullptr, 0);
+}
 
 /** Perform a select() or equivalent call.
  * This is used by the main select loop engine to check for FD with IO available.
  */
-comm_err_t DoSelect(int);
+Comm::Flag DoSelect(int);
 
 void QuickPollRequired(void);
 
@@ -36,7 +44,7 @@ void QuickPollRequired(void);
  * This is a per-port limit for ICP/HTCP ports.
  * DNS has a separate limit.
  */
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #define INCOMING_UDP_MAX 1
 #else
 #define INCOMING_UDP_MAX 15
@@ -45,7 +53,7 @@ void QuickPollRequired(void);
 /**
  * Max number of DNS messages to receive per call to DNS read handler
  */
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #define INCOMING_DNS_MAX 1
 #else
 #define INCOMING_DNS_MAX 15
@@ -55,7 +63,7 @@ void QuickPollRequired(void);
  * Max number of new TCP connections to accept per call to the TCP listener poller.
  * This is a per-port limit for HTTP/HTTPS ports.
  */
-#if _SQUID_MSWIN_
+#if _SQUID_WINDOWS_
 #define INCOMING_TCP_MAX 1
 #else
 #define INCOMING_TCP_MAX 10
@@ -65,3 +73,4 @@ void QuickPollRequired(void);
 } // namespace Comm
 
 #endif /* _SQUID_SRC_COMM_LOOPS_H */
+