From: amosjeffries <> Date: Mon, 25 Feb 2008 10:45:24 +0000 (+0000) Subject: Author: hno X-Git-Tag: SQUID_3_0_STABLE2~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b91959e0466a08fb0d57e15414b45debad9ac19b;p=thirdparty%2Fsquid.git Author: hno 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(). --- diff --git a/src/comm.cc b/src/comm.cc index 02157c5389..03628e9e10 100644 --- a/src/comm.cc +++ b/src/comm.cc @@ -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]; diff --git a/src/comm.h b/src/comm.h index db8b62a9bb..ceaab1ec76 100644 --- a/src/comm.h +++ b/src/comm.h @@ -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); diff --git a/src/comm_epoll.cc b/src/comm_epoll.cc index 51ac3be614..d69a627b4b 100644 --- a/src/comm_epoll.cc +++ b/src/comm_epoll.cc @@ -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); diff --git a/src/comm_kqueue.cc b/src/comm_kqueue.cc index d759e28fb5..74af6e1ef6 100644 --- a/src/comm_kqueue.cc +++ b/src/comm_kqueue.cc @@ -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 diff --git a/src/comm_poll.cc b/src/comm_poll.cc index b6d9354027..cd160c2bc8 100644 --- a/src/comm_poll.cc +++ b/src/comm_poll.cc @@ -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) { diff --git a/src/comm_select.cc b/src/comm_select.cc index 64d90092e1..7b09fe4e3c 100644 --- a/src/comm_select.cc +++ b/src/comm_select.cc @@ -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) diff --git a/src/comm_select_win32.cc b/src/comm_select_win32.cc index fc69d27720..0498f83bc7 100644 --- a/src/comm_select_win32.cc +++ b/src/comm_select_win32.cc @@ -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)