From ecc6b895f60f149122eee9a3df2342e4b738fd0e Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 7 Jun 2000 00:22:01 +0000 Subject: Ready to merge in Julian Haight's changes. svn path=/trunk/; revision=2899 --- socket.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'socket.c') diff --git a/socket.c b/socket.c index f95bae81..8c64d5f2 100644 --- a/socket.c +++ b/socket.c @@ -709,12 +709,18 @@ int SockClose(int sock) } #endif - /* Half-close the connection first so the other end gets notified. +#ifdef __UNUSED__ + /* + * This hangs in RedHat 6.2 after fetchmail runs for a while a + * FIN_WAIT2 comes up in netstat and fetchmail never returns from + * the recv system call. (Reported from jtnews + * , Wed, 24 May 2000 21:26:02.) + * + * Half-close the connection first so the other end gets notified. * * This stops sends but allows receives (effectively, it sends a - * TCP ). - */ - if (shutdown(sock, 1) == 0) + * TCP ). */ + if (shutdown(sock, 1) == 0) { /* If there is any data still waiting in the queue, discard it. * Call recv() until either it returns 0 (meaning we received a FIN) * or any error occurs. This makes sure all data sent by the other @@ -723,6 +729,8 @@ int SockClose(int sock) if (fm_peek(sock, &ch, 1) > 0) while (fm_read(sock, &ch, 1) > 0) continue; + } +#endif /* __UNUSED__ */ /* if there's an error closing at this point, not much we can do */ return(fm_close(sock)); /* this is guarded */ -- cgit v1.2.3