aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2000-06-07 00:22:01 +0000
committerEric S. Raymond <esr@thyrsus.com>2000-06-07 00:22:01 +0000
commitecc6b895f60f149122eee9a3df2342e4b738fd0e (patch)
tree8c0eef3c29edd622dbfba6055d56056b5f0491db /socket.c
parentacd8b10a2110ff8b76bc589896a77decd1248446 (diff)
downloadfetchmail-ecc6b895f60f149122eee9a3df2342e4b738fd0e.tar.gz
fetchmail-ecc6b895f60f149122eee9a3df2342e4b738fd0e.tar.bz2
fetchmail-ecc6b895f60f149122eee9a3df2342e4b738fd0e.zip
Ready to merge in Julian Haight's changes.
svn path=/trunk/; revision=2899
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c16
1 files changed, 12 insertions, 4 deletions
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
+ * <jtnews@bellatlantic.net>, 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 <FIN>).
- */
- if (shutdown(sock, 1) == 0)
+ * TCP <FIN>). */
+ 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 */