X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Feventl.c;h=5e219ca6fab1164e386a70fdbbfd2459254d45d9;hp=2d642ca637fe02213de6c846e4e609ad2089041a;hb=c2d4d247b3fe28f7c191fbc3644c8e011e1a4fea;hpb=379504a233e3e2cc85bca1e7b6d864f1395aec7c diff --git a/src/eventl.c b/src/eventl.c index 2d642ca..5e219ca 100644 --- a/src/eventl.c +++ b/src/eventl.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2009 Index Data + * Copyright (C) 1995-2010 Index Data * See the file LICENSE for details. */ @@ -29,6 +29,7 @@ #include #include #include +#include #include "eventl.h" #include "session.h" #include @@ -116,8 +117,9 @@ int iochan_event_loop(IOCHAN *iochans) w = p->max_idle; else w = ftime - now; + /* tv_sec will be minimum wait.. */ if (w < tv_sec) - tv_sec = w; + tv_sec = (int) w; /* can hold it because w < tv_sec */ } fds[i].fd = p->fd; fds[i].input_mask = input_mask; @@ -137,15 +139,9 @@ int iochan_event_loop(IOCHAN *iochans) } else { - /* Destroy the first member in the chain, and try again */ - association *assoc = (association *)iochan_getdata(*iochans); - COMSTACK conn = assoc->client_link; - - cs_close(conn); - destroy_association(assoc); - iochan_destroy(*iochans); - yaz_log(log_level, "error select, destroying iochan %p", - *iochans); + yaz_log(YLOG_WARN|YLOG_ERRNO, "yaz_poll"); + xfree(fds); + continue; } } now = time(0);