提交 60e0a026 authored 作者: Anthony Minessale's avatar Anthony Minessale

tweak

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@783 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 193bb790
...@@ -878,6 +878,7 @@ static __inline__ void check_events(zap_span_t *span) ...@@ -878,6 +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);
} }
break; break;
default: default:
...@@ -947,6 +948,7 @@ static int on_dchan_up(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_ev ...@@ -947,6 +948,7 @@ static int on_dchan_up(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_ev
if (!zap_test_flag(spri, LPWRAP_PRI_READY)) { if (!zap_test_flag(spri, LPWRAP_PRI_READY)) {
zap_log(ZAP_LOG_INFO, "Span %d D-Chan UP!\n", spri->span->span_id); zap_log(ZAP_LOG_INFO, "Span %d D-Chan UP!\n", spri->span->span_id);
zap_set_flag(spri, LPWRAP_PRI_READY); zap_set_flag(spri, LPWRAP_PRI_READY);
zap_set_state_all(spri->span, ZAP_CHANNEL_STATE_RESTART);
} }
return 0; return 0;
...@@ -965,6 +967,8 @@ static int on_dchan_down(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_ ...@@ -965,6 +967,8 @@ static int on_dchan_down(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_
if (zap_test_flag(spri, LPWRAP_PRI_READY)) { if (zap_test_flag(spri, LPWRAP_PRI_READY)) {
zap_log(ZAP_LOG_INFO, "Span %d D-Chan DOWN!\n", spri->span->span_id); zap_log(ZAP_LOG_INFO, "Span %d D-Chan DOWN!\n", spri->span->span_id);
zap_clear_flag(spri, LPWRAP_PRI_READY); zap_clear_flag(spri, LPWRAP_PRI_READY);
zap_set_state_all(spri->span, ZAP_CHANNEL_STATE_RESTART);
} }
return 0; return 0;
......
...@@ -1055,10 +1055,11 @@ static ZIO_READ_FUNCTION(zt_read) ...@@ -1055,10 +1055,11 @@ static ZIO_READ_FUNCTION(zt_read)
zap_ssize_t r = 0; zap_ssize_t r = 0;
int errs = 0; int errs = 0;
while (errs++ < 300) { while (errs++ < 30) {
if ((r = read(zchan->sockfd, data, *datalen)) > 0) { if ((r = read(zchan->sockfd, data, *datalen)) > 0) {
break; break;
} }
zap_sleep(10);
if (r == 0) { if (r == 0) {
errs--; errs--;
} }
...@@ -1070,6 +1071,11 @@ static ZIO_READ_FUNCTION(zt_read) ...@@ -1070,6 +1071,11 @@ 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;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论