Closed thesues closed 12 years ago
when booth client close connection remotelly, boothd site can not close its own fd. this patch would fix this, I think
commit df4804ce6f14d6f5b4020c5a7f5070eb1f32d930 Author: root root@linux-x5e9.site Date: Wed Mar 7 12:51:15 2012 +0800
fix tcp always re-connect
diff --git a/src/main.c b/src/main.c index d4f62da..0d16307 100644 --- a/src/main.c +++ b/src/main.c @@ -41,6 +41,7 @@
+#include
@@ -257,10 +258,22 @@ void process_connection(int ci) char data = NULL; char site, *ticket; int local, rv;
void (*deadfn) (int ci);
rv = do_read(client[ci].fd, &h, sizeof(h)); + if (rv < 0) { log_error("connection %d read error %d", ci, rv);
} return;
} if (h.magic != BOOTHC_MAGIC) { @@ -358,7 +371,7 @@ static void process_listener(int ci)
i = client_add(fd, process_connection, NULL);
log_debug("add client connection %d fd %d", i, fd); }
static int setup_config(int type)
when booth client close connection remotelly, boothd site can not close its own fd. this patch would fix this, I think
commit df4804ce6f14d6f5b4020c5a7f5070eb1f32d930 Author: root root@linux-x5e9.site Date: Wed Mar 7 12:51:15 2012 +0800
diff --git a/src/main.c b/src/main.c index d4f62da..0d16307 100644 --- a/src/main.c +++ b/src/main.c @@ -41,6 +41,7 @@
include "timer.h"
include "pacemaker.h"
include "ticket.h"
+#include
define RELEASE_VERSION "1.0"
@@ -257,10 +258,22 @@ void process_connection(int ci) char data = NULL; char site, *ticket; int local, rv;
void (*deadfn) (int ci);
rv = do_read(client[ci].fd, &h, sizeof(h)); + if (rv < 0) { log_error("connection %d read error %d", ci, rv);
} if (h.magic != BOOTHC_MAGIC) { @@ -358,7 +371,7 @@ static void process_listener(int ci)
i = client_add(fd, process_connection, NULL);
log_debug("add client connection %d fd %d", i, fd); }
static int setup_config(int type)