git-svn-id: http://svn.openzap.org/svn/openzap/trunk@785 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2009-07-27 23:48:52 +00:00
parent 0b34fdfc48
commit 31ca630edc
4 changed files with 8 additions and 9 deletions

View File

@ -120,9 +120,11 @@ static int __pri_lpwrap_read(struct pri *pri, void *buf, int buflen)
if ((zst = zap_channel_read(spri->dchan, buf, &len)) != ZAP_SUCCESS) {
if (zst == ZAP_FAIL) {
zap_log(ZAP_LOG_CRIT, "span %d D-READ FAIL! [%s]\n", spri->span->span_id, spri->dchan->last_error);
spri->errs++;
} else {
zap_log(ZAP_LOG_CRIT, "span %d D-READ TIMEOUT\n", spri->span->span_id);
}
zap_clear_flag(spri, LPWRAP_PRI_READY);
return -1;
}
@ -203,9 +205,10 @@ int lpwrap_one_loop(struct lpwrap_pri *spri)
}
}
//if (!zap_test_flag(spri, LPWRAP_PRI_READY)) {
//return -1;
//}
if (spri->errs >= 2) {
spri->errs = 0;
return -1;
}
FD_ZERO(&rfds);
FD_ZERO(&efds);

View File

@ -103,6 +103,7 @@ struct lpwrap_pri {
void *private_info;
event_handler eventmap[LPWRAP_PRI_EVENT_MAX];
loop_handler on_loop;
int errs;
};
typedef struct lpwrap_pri lpwrap_pri_t;

View File

@ -878,7 +878,7 @@ static __inline__ void check_events(zap_span_t *span)
case ZAP_FAIL:
{
zap_log(ZAP_LOG_DEBUG, "Event Failure! %d\n", zap_running());
zap_sleep(5000);
zap_sleep(2000);
}
break;
default:

View File

@ -1071,11 +1071,6 @@ static ZIO_READ_FUNCTION(zt_read)
*datalen -= 2;
}
return ZAP_SUCCESS;
} else {
if (zchan->type == ZAP_CHAN_TYPE_DQ921) {
unsigned char buf[25] = {0};
write(zchan->sockfd, buf, sizeof(buf));
}
}
return r == 0 ? ZAP_TIMEOUT : ZAP_FAIL;