From 2e7355bb9282c1b17689863445233d1b735cc8ea Mon Sep 17 00:00:00 2001 From: angt Date: Fri, 27 Nov 2015 07:44:45 +0100 Subject: [PATCH] Write shutdown() should be called only one time --- src/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 6609e17..32ba673 100644 --- a/src/main.c +++ b/src/main.c @@ -967,7 +967,8 @@ int main (int argc, char **argv) if (r>0) sock.write.read += r; } else { - if (stop_loop) { + if (stop_loop && !(stop_loop>>2)) { + stop_loop |= (1<<2); gt_log("%s: shutdown\n", sockname); shutdown(sock.fd, SHUT_WR); }