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

update

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@26 a93c3328-9c30-0410-af19-c9cd2b2d52af
上级 73ca7fc4
......@@ -24,15 +24,21 @@ int main(int argc, char *argv[])
printf("set interval failed\n");
}
for(x = 0; x < 25; x++) {
unsigned char buf[160];
unsigned char buf[80];
zap_size_t len = sizeof(buf);
if (zap_channel_read(chan, buf, &len) == ZAP_SUCCESS) {
printf("READ: %d\n", len);
zap_wait_flag_t flags = ZAP_READ;
zap_channel_wait(chan, &flags, 0);
if (flags & ZAP_READ) {
if (zap_channel_read(chan, buf, &len) == ZAP_SUCCESS) {
printf("READ: %d\n", len);
} else {
printf("READ FAIL! %d\n", len);
break;
}
} else {
printf("FAIL! %d\n", len);
break;
printf("wait fail\n");
}
}
}
......
......@@ -326,8 +326,6 @@ static ZINT_WAIT_FUNCTION(wanpipe_wait)
int s;
struct timeval tv, *tvp = NULL;
ZINT_WAIT_MUZZLE;
if (to) {
memset(&tv, 0, sizeof(tv));
tv.tv_sec = to / 1000;
......@@ -357,7 +355,7 @@ static ZINT_WAIT_FUNCTION(wanpipe_wait)
*flags = ZAP_NO_FLAGS;
s = select(zchan->sockfd + 1, r, w, e, tvp);
if (s < 0) {
return ZAP_FAIL;
}
......@@ -411,6 +409,7 @@ static ZINT_READ_FUNCTION(wanpipe_read_unix)
*datalen = rx_len;
if (rx_len <= 0) {
perror("wtf");
return ZAP_FAIL;
}
......@@ -433,7 +432,7 @@ static ZINT_WRITE_FUNCTION(wanpipe_write_unix)
int bsent;
struct msghdr msg;
struct iovec iov[2];
wp_tdm_api_rx_hdr_t hdrframe;
wp_tdm_api_tx_hdr_t hdrframe;
memset(&msg, 0, sizeof(msg));
memset(&hdrframe, 0, sizeof(hdrframe));
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论