]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Windows: use Comm::Connection ICP sockets
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Mar 2012 00:54:17 +0000 (18:54 -0600)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 16 Mar 2012 00:54:17 +0000 (18:54 -0600)
src/comm/ModSelect.cc
src/comm/ModSelectWin32.cc

index c882569be760a10e571aed119bb3322b5eb1daf9..0de9dce3ad2ece714ddd90a364a0be3a4a2e41b7 100644 (file)
 #include "squid-old.h"
 #include "comm/Connection.h"
 #include "comm/Loops.h"
+#include "fde.h"
 #include "ICP.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
 #include "StatHist.h"
 #include "Store.h"
-#include "fde.h"
 
 static int MAX_POLL_TIME = 1000;       /* see also Comm::QuickPollRequired() */
 
index 92716bd8f2f6e74db63c992d46f4a98547212732..da3ea49fa99b0d930a4dc96cdb62ecf331bf1ed5 100644 (file)
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA.
  *
  */
-
 #include "squid.h"
 
 #if USE_SELECT_WIN32
 
 #include "squid-old.h"
+#include "comm/Connection.h"
 #include "comm/Loops.h"
 #include "fde.h"
+#include "ICP.h"
 #include "mgr/Registration.h"
 #include "SquidTime.h"
 #include "StatCounters.h"
@@ -168,10 +169,10 @@ Comm::ResetSelect(int fd)
 static int
 fdIsIcp(int fd)
 {
-    if (fd == theInIcpConnection)
+    if (icpIncomingConn != NULL && fd == icpIncomingConn->fd)
         return 1;
 
-    if (fd == theOutIcpConnection)
+    if (icpOutgoingConn != NULL && fd == icpOutgoingConn->fd)
         return 1;
 
     return 0;
@@ -281,12 +282,11 @@ comm_select_icp_incoming(void)
     int nevents;
     icp_io_events = 0;
 
-    if (theInIcpConnection >= 0)
-        fds[nfds++] = theInIcpConnection;
+    if (Comm::IsConnOpen(icpIncomingConn))
+        fds[nfds++] = icpIncomingConn->fd;
 
-    if (theInIcpConnection != theOutIcpConnection)
-        if (theOutIcpConnection >= 0)
-            fds[nfds++] = theOutIcpConnection;
+    if (Comm::IsConnOpen(icpOutgoingConn) && icpIncomingConn != icpOutgoingConn)
+        fds[nfds++] = icpOutgoingConn->fd;
 
     if (nfds == 0)
         return;