From df76bafd6d279491f917c72b1023a95ed6a0f952 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 24 May 2007 13:39:40 +0000 Subject: [PATCH] merge git-svn-id: http://svn.openzap.org/svn/openzap/trunk@133 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/zap_analog.c | 1 - libs/openzap/src/zap_wanpipe.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/openzap/src/zap_analog.c b/libs/openzap/src/zap_analog.c index c9e93bdb83..1021dbae27 100644 --- a/libs/openzap/src/zap_analog.c +++ b/libs/openzap/src/zap_analog.c @@ -201,7 +201,6 @@ static void *zap_analog_run(zap_thread_t *me, void *obj) status = zap_span_poll_event(span, waitms); switch(status) { - case ZAP_TIMEOUT: case ZAP_SUCCESS: { zap_event_t *event; diff --git a/libs/openzap/src/zap_wanpipe.c b/libs/openzap/src/zap_wanpipe.c index dbe48cd061..448bc146cd 100644 --- a/libs/openzap/src/zap_wanpipe.c +++ b/libs/openzap/src/zap_wanpipe.c @@ -416,20 +416,26 @@ static ZIO_WAIT_FUNCTION(wanpipe_wait) ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event) { struct pollfd pfds[ZAP_MAX_CHANNELS_SPAN]; - int i, j = 0, k = 0, r; + int i, j = 0, k = 0, l = 0, r; for(i = 1; i <= span->chan_count; i++) { memset(&pfds[j], 0, sizeof(pfds[j])); pfds[j].fd = span->channels[i].sockfd; pfds[j].events = POLLPRI; - //printf("set %d=%d\n", j, pfds[j].fd); + if (zap_test_flag((&span->channels[i]), ZAP_CHANNEL_WINK) || zap_test_flag((&span->channels[i]), ZAP_CHANNEL_FLASH)) { + l++; + } j++; } + if (l) { + ms = 5; + } + r = poll(pfds, j, ms); if (r == 0) { - return ZAP_TIMEOUT; + return l ? ZAP_SUCCESS : ZAP_TIMEOUT; } else if (r < 0) { snprintf(span->last_error, sizeof(span->last_error), "%s", strerror(errno)); return ZAP_FAIL;