From 7d7cc0b18839b9a78048041d882c1f3baf006c29 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 14 Sep 2006 13:50:24 +0000 Subject: [PATCH] Fixed bug in Generic Frontend Server that could cause a server to stop accepting new connections. Bug only seen on two CPU systems on 2003 server. --- src/statserv.c | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/statserv.c b/src/statserv.c index bed22d0..bad214c 100644 --- a/src/statserv.c +++ b/src/statserv.c @@ -5,7 +5,7 @@ * NT threaded server code by * Chas Woodfield, Fretwell Downing Informatics. * - * $Id: statserv.c,v 1.41 2006-09-06 09:35:42 adam Exp $ + * $Id: statserv.c,v 1.42 2006-09-14 13:50:24 adam Exp $ */ /** @@ -770,27 +770,21 @@ static void listener(IOCHAN h, int event) if (event == EVENT_INPUT) { + COMSTACK new_line; + IOCHAN new_chan; + if ((res = cs_listen(line, 0, 0)) < 0) { - yaz_log(YLOG_FATAL, "cs_listen failed"); + yaz_log(YLOG_FATAL|YLOG_ERRNO, "cs_listen failed"); return; } else if (res == 1) - return; + return; /* incomplete */ yaz_log(YLOG_DEBUG, "listen ok"); - iochan_setevent(h, EVENT_OUTPUT); - iochan_setflags(h, EVENT_OUTPUT | EVENT_EXCEPT); /* set up for acpt */ - } - else if (event == EVENT_OUTPUT) - { - COMSTACK new_line = cs_accept(line); - IOCHAN new_chan; - char *a = NULL; - - if (!new_line) + new_line = cs_accept(line); + if (!new_line) { yaz_log(YLOG_FATAL, "Accept failed."); - iochan_setflags(h, EVENT_INPUT | EVENT_EXCEPT); return; } yaz_log(YLOG_DEBUG, "Accept ok"); -- 1.7.10.4