]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Author: hno
authoramosjeffries <>
Mon, 25 Feb 2008 10:45:24 +0000 (10:45 +0000)
committeramosjeffries <>
Mon, 25 Feb 2008 10:45:24 +0000 (10:45 +0000)
Bug #2150: Connection hangs on automatic retry

With epoll and probably kqueue as well the filedescriptor need to be
reregistered with the kernle after being replaced with dup2().

src/comm.cc
src/comm.h
src/comm_epoll.cc
src/comm_kqueue.cc
src/comm_poll.cc
src/comm_select.cc
src/comm_select_win32.cc

index 02157c538987b29b7093beee9fe69203d6049074..03628e9e10b5b78aaade19ce78769b8bad6142eb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: comm.cc,v 1.438 2007/10/31 04:52:16 amosjeffries Exp $
+ * $Id: comm.cc,v 1.438.2.1 2008/02/25 03:45:24 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  * AUTHOR: Harvest Derived
@@ -1103,6 +1103,7 @@ ConnectStateData::commResetFD()
 
         return 0;
     }
+    commResetSelect(fd);
 
     close(fd2);
     fde *F = &fd_table[fd];
index db8b62a9bb658f6850f18bd30c18e735b28f71c0..ceaab1ec76fe3e2c5ee4e9f294a6581ad5bb21c0 100644 (file)
@@ -57,6 +57,7 @@ SQUIDCEXTERN u_short comm_local_port(int fd);
 SQUIDCEXTERN int comm_set_tos(int fd, int tos);
 
 SQUIDCEXTERN void commSetSelect(int, unsigned int, PF *, void *, time_t);
+SQUIDCEXTERN void commResetSelect(int);
 
 SQUIDCEXTERN int comm_udp_sendto(int, const struct sockaddr_in *, int, const void *, int);
 extern void comm_write(int fd, const char *buf, int len, IOCB *callback, void *callback_data, FREE *func);
index 51ac3be614c62e7058b90b0ced8067773ef751f8..d69a627b4b9c3c2aa2dcc7bd10f24869c5023dcf 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_epoll.cc,v 1.17 2007/07/19 13:33:18 hno Exp $
+ * $Id: comm_epoll.cc,v 1.17.2.1 2008/02/25 03:45:24 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -203,6 +203,14 @@ commSetSelect(int fd, unsigned int type, PF * handler,
         F->timeout = squid_curtime + timeout;
 }
 
+void
+commResetSelect(int fd)
+{
+    fde *F = &fd_table[fd];
+    F->epoll_state = 0;
+    commSetSelect(fd, 0, NULL, NULL, 0);
+}
+
 
 static void commIncomingStats(StoreEntry * sentry);
 
index d759e28fb5650a0dfeeffa70950f3e555918b697..74af6e1ef684e9619b5bf48676dc36a57befa382 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_kqueue.cc,v 1.17 2007/07/19 13:33:18 hno Exp $
+ * $Id: comm_kqueue.cc,v 1.17.2.1 2008/02/25 03:45:24 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -210,6 +210,18 @@ commSetSelect(int fd, unsigned int type, PF * handler,
 
 }
 
+void
+commResetSelect(int fd)
+{
+    fde *F = &fd_table[fd];
+    if (F->read_handler) {
+       kq_update_events(fd, EVFILT_READ, (PF *)1);
+    }
+    if (F->write_handler) {
+       kq_update_events(fd, EVFILT_WRITE, (PF *)1);
+    }
+}
+
 /*
  * Check all connections for new connections and input data that is to be
  * processed. Also check for connections with data queued and whether we can
index b6d93540275a7426a8a9cfa64cb3942361c8f972..cd160c2bc84d9c1e6ab389c79467d6f0cf9a2573 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_poll.cc,v 1.24 2007/09/01 13:09:59 hno Exp $
+ * $Id: comm_poll.cc,v 1.24.2.1 2008/02/25 03:45:24 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -145,6 +145,11 @@ commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
         F->timeout = squid_curtime + timeout;
 }
 
+void
+commResetSelect(int fd)
+{
+}
+
 static int
 fdIsIcp(int fd)
 {
index 64d90092e1a888f50589724a6a774942688ad792..7b09fe4e3c38545694beed62079ced9baacad5ca 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_select.cc,v 1.81 2007/06/10 12:13:31 hno Exp $
+ * $Id: comm_select.cc,v 1.81.4.1 2008/02/25 03:45:24 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -156,6 +156,10 @@ commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
         F->timeout = squid_curtime + timeout;
 }
 
+void
+commResetSelect(int fd)
+{
+}
 
 static int
 fdIsIcp(int fd)
index fc69d27720e8e581fc7f8839cba06abe7a76919e..0498f83bc70057d540ab52e63b2bd994019d991c 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: comm_select_win32.cc,v 1.4.4.2 2008/02/24 13:00:50 serassio Exp $
+ * $Id: comm_select_win32.cc,v 1.4.4.3 2008/02/25 03:45:24 amosjeffries Exp $
  *
  * DEBUG: section 5     Socket Functions
  *
@@ -156,6 +156,11 @@ commSetSelect(int fd, unsigned int type, PF * handler, void *client_data,
         F->timeout = squid_curtime + timeout;
 }
 
+void
+commResetSelect(int fd)
+{
+}
+
 
 static int
 fdIsIcp(int fd)