merge
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@133 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
74b55a890e
commit
df76bafd6d
|
@ -201,7 +201,6 @@ static void *zap_analog_run(zap_thread_t *me, void *obj)
|
||||||
status = zap_span_poll_event(span, waitms);
|
status = zap_span_poll_event(span, waitms);
|
||||||
|
|
||||||
switch(status) {
|
switch(status) {
|
||||||
case ZAP_TIMEOUT:
|
|
||||||
case ZAP_SUCCESS:
|
case ZAP_SUCCESS:
|
||||||
{
|
{
|
||||||
zap_event_t *event;
|
zap_event_t *event;
|
||||||
|
|
|
@ -416,20 +416,26 @@ static ZIO_WAIT_FUNCTION(wanpipe_wait)
|
||||||
ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
|
ZIO_SPAN_POLL_EVENT_FUNCTION(wanpipe_poll_event)
|
||||||
{
|
{
|
||||||
struct pollfd pfds[ZAP_MAX_CHANNELS_SPAN];
|
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++) {
|
for(i = 1; i <= span->chan_count; i++) {
|
||||||
memset(&pfds[j], 0, sizeof(pfds[j]));
|
memset(&pfds[j], 0, sizeof(pfds[j]));
|
||||||
pfds[j].fd = span->channels[i].sockfd;
|
pfds[j].fd = span->channels[i].sockfd;
|
||||||
pfds[j].events = POLLPRI;
|
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++;
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (l) {
|
||||||
|
ms = 5;
|
||||||
|
}
|
||||||
|
|
||||||
r = poll(pfds, j, ms);
|
r = poll(pfds, j, ms);
|
||||||
|
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
return ZAP_TIMEOUT;
|
return l ? ZAP_SUCCESS : ZAP_TIMEOUT;
|
||||||
} else if (r < 0) {
|
} else if (r < 0) {
|
||||||
snprintf(span->last_error, sizeof(span->last_error), "%s", strerror(errno));
|
snprintf(span->last_error, sizeof(span->last_error), "%s", strerror(errno));
|
||||||
return ZAP_FAIL;
|
return ZAP_FAIL;
|
||||||
|
|
Loading…
Reference in New Issue