update
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@785 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
parent
0b6fdf0e0b
commit
98cdec8d6f
|
@ -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_channel_read(spri->dchan, buf, &len)) != ZAP_SUCCESS) {
|
||||||
if (zst == ZAP_FAIL) {
|
if (zst == ZAP_FAIL) {
|
||||||
zap_log(ZAP_LOG_CRIT, "span %d D-READ FAIL! [%s]\n", spri->span->span_id, spri->dchan->last_error);
|
zap_log(ZAP_LOG_CRIT, "span %d D-READ FAIL! [%s]\n", spri->span->span_id, spri->dchan->last_error);
|
||||||
|
spri->errs++;
|
||||||
} else {
|
} else {
|
||||||
zap_log(ZAP_LOG_CRIT, "span %d D-READ TIMEOUT\n", spri->span->span_id);
|
zap_log(ZAP_LOG_CRIT, "span %d D-READ TIMEOUT\n", spri->span->span_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
zap_clear_flag(spri, LPWRAP_PRI_READY);
|
zap_clear_flag(spri, LPWRAP_PRI_READY);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -203,9 +205,10 @@ int lpwrap_one_loop(struct lpwrap_pri *spri)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (!zap_test_flag(spri, LPWRAP_PRI_READY)) {
|
if (spri->errs >= 2) {
|
||||||
//return -1;
|
spri->errs = 0;
|
||||||
//}
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_ZERO(&efds);
|
FD_ZERO(&efds);
|
||||||
|
|
|
@ -103,6 +103,7 @@ struct lpwrap_pri {
|
||||||
void *private_info;
|
void *private_info;
|
||||||
event_handler eventmap[LPWRAP_PRI_EVENT_MAX];
|
event_handler eventmap[LPWRAP_PRI_EVENT_MAX];
|
||||||
loop_handler on_loop;
|
loop_handler on_loop;
|
||||||
|
int errs;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct lpwrap_pri lpwrap_pri_t;
|
typedef struct lpwrap_pri lpwrap_pri_t;
|
||||||
|
|
|
@ -878,7 +878,7 @@ static __inline__ void check_events(zap_span_t *span)
|
||||||
case ZAP_FAIL:
|
case ZAP_FAIL:
|
||||||
{
|
{
|
||||||
zap_log(ZAP_LOG_DEBUG, "Event Failure! %d\n", zap_running());
|
zap_log(ZAP_LOG_DEBUG, "Event Failure! %d\n", zap_running());
|
||||||
zap_sleep(5000);
|
zap_sleep(2000);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -1071,11 +1071,6 @@ static ZIO_READ_FUNCTION(zt_read)
|
||||||
*datalen -= 2;
|
*datalen -= 2;
|
||||||
}
|
}
|
||||||
return ZAP_SUCCESS;
|
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;
|
return r == 0 ? ZAP_TIMEOUT : ZAP_FAIL;
|
||||||
|
|
Loading…
Reference in New Issue