From da910d54b36d3d31b0b447930dd3c478662af99e Mon Sep 17 00:00:00 2001
From: Travis Glenn Hansen <travisghansen@yahoo.com>
Date: Wed, 17 Oct 2012 10:21:37 -0600
Subject: [PATCH] more code to prevent infinite loop

---
 fanout.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fanout.c b/fanout.c
index cf60920..afeb367 100644
--- a/fanout.c
+++ b/fanout.c
@@ -567,6 +567,10 @@ resetting counter\n");
                       &optval, optlen)) == -1)
                     fanout_error ("failed setting keepalive");
 
+                 if ((setsockopt (client_i->fd, SOL_SOCKET, SO_LINGER,
+                       &so_linger, sizeof so_linger)) == -1)
+                     fanout_error ("failed setting linger");
+
                 //Shove current new connection in the front of the line
                 client_i->next = client_head;
                 if (client_head != NULL) {
-- 
GitLab