From 11132c40c921118c3fbd036543af8682f18394a6 Mon Sep 17 00:00:00 2001 From: gardners Date: Thu, 3 May 2012 16:16:36 +0930 Subject: [PATCH] fixed big fat nasty socket handling bug. --- monitor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monitor.c b/monitor.c index 0000c733..97f3f7e9 100644 --- a/monitor.c +++ b/monitor.c @@ -209,9 +209,10 @@ int monitor_poll() nextInSameSlot: errno=0; int bytes; - struct monitor_context *c=&monitor_sockets[monitor_socket_count]; + struct monitor_context *c=&monitor_sockets[i]; fcntl(c->socket,F_SETFL, fcntl(c->socket, F_GETFL, NULL)|O_NONBLOCK); + WHYF("looking at monitor socket #%d",i); switch(c->state) { case MONITOR_STATE_COMMAND: bytes=1; @@ -285,6 +286,9 @@ int monitor_poll() } } break; + default: + c->state=MONITOR_STATE_COMMAND; + WHY("fixed monitor connection state"); } }