X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=zoom%2Fzoom-c.c;fp=zoom%2Fzoom-c.c;h=2ea510a9a7ca7b532e5c02cb6c4f58ab070da764;hb=87efa99fe797d07045266a5e0d876ac8b0e28a34;hp=3fbd46b1fbf58383c349852d5e5375b40e98affb;hpb=0e8b1116b97d769ea233858fe3c2ced5d1da5d7c;p=yaz-moved-to-github.git diff --git a/zoom/zoom-c.c b/zoom/zoom-c.c index 3fbd46b..2ea510a 100644 --- a/zoom/zoom-c.c +++ b/zoom/zoom-c.c @@ -1,5 +1,5 @@ /* - * $Id: zoom-c.c,v 1.38 2002-07-29 19:51:34 adam Exp $ + * $Id: zoom-c.c,v 1.39 2002-08-19 21:09:10 adam Exp $ * * ZOOM layer for C, connections, result sets, queries. */ @@ -2302,6 +2302,7 @@ ZOOM_connection_last_event(ZOOM_connection cs) ZOOM_API(int) ZOOM_event (int no, ZOOM_connection *cs) { + int timeout = 5000; #if HAVE_SYS_POLL_H struct pollfd pollfds[1024]; ZOOM_connection poll_cs[1024]; @@ -2338,18 +2339,17 @@ ZOOM_event (int no, ZOOM_connection *cs) #if HAVE_SYS_POLL_H #else - tv.tv_sec = 25; - tv.tv_usec = 0; - FD_ZERO (&input); FD_ZERO (&output); FD_ZERO (&except); #endif + yaz_log (LOG_LOG, "select begin"); nfds = 0; for (i = 0; ioptions, "timeout", -1); + if (this_timeout != -1 && this_timeout < timeout) + timeout = this_timeout; + yaz_log (LOG_LOG, "time_timeout = %d, p=%p, timeout=%d", this_timeout, + c, timeout); #if HAVE_SYS_POLL_H if (mask) { @@ -2396,10 +2401,15 @@ ZOOM_event (int no, ZOOM_connection *cs) } #endif } + if (timeout >= 5000) + timeout = 30; + if (!nfds) return 0; + yaz_log (LOG_LOG, "select with timeout %d", timeout); + #if HAVE_SYS_POLL_H - r = poll (pollfds, nfds, 25000); + r = poll (pollfds, nfds, timeout * 1000); for (i = 0; i