version 1.17.2.2, 2015/05/18 14:50:12
|
version 1.17.2.3, 2015/05/18 15:00:54
|
Line 177 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
Line 177 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
salen = sa2.ss.ss_len = sizeof(sockaddr_t); |
salen = sa2.ss.ss_len = sizeof(sockaddr_t); |
|
|
for (len = blen; len > 0; len -= ret, buf += ret) { |
for (len = blen; len > 0; len -= ret, buf += ret) { |
printf("%s_0. buf=%p len=%d\n", __func__, buf, len); |
|
if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || |
if ((ret = poll(&pfd, 1, DEF_RPC_TIMEOUT * 1000)) < 1 || |
pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { |
pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) { |
if (ret) |
if (ret) |
Line 262 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
Line 261 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
/* check RPC packet header */ |
/* check RPC packet header */ |
if ((u_char*) rpc == buf) { |
if ((u_char*) rpc == buf) { |
if (type == SOCK_RAW) { |
if (type == SOCK_RAW) { |
printf("raw: ret=%d\n", ret); |
|
hlen = sa->sa.sa_family == AF_INET ? sizeof(struct ip) : sizeof(struct ip6_hdr); |
hlen = sa->sa.sa_family == AF_INET ? sizeof(struct ip) : sizeof(struct ip6_hdr); |
ret -= hlen; |
ret -= hlen; |
printf("raw-cx: ret=%d\n", ret); |
|
if (ret > 0) |
if (ret > 0) |
memmove(buf, buf + hlen, blen - hlen); |
memmove(buf, buf + hlen, blen - hlen); |
printf("%s ret=%d call_io=0x%x call_len=%d call_seq=%u\n", __func__, ret, rpc->call_io, ntohl(rpc->call_len), ntohl(rpc->call_seq)); |
|
fflush(stdout); |
|
} |
} |
|
|
/* 1st read for RPC header */ |
/* 1st read for RPC header */ |
Line 286 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
Line 281 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
} |
} |
/* calc estimated length */ |
/* calc estimated length */ |
blen = len = ntohl(rpc->call_len); |
blen = len = ntohl(rpc->call_len); |
printf("blen=%d len=%d ret=%d\n", blen, len, ret); |
|
if (blen > AIT_LEN(pkt)) { |
if (blen > AIT_LEN(pkt)) { |
AIT_RE_BUF(pkt, blen); |
AIT_RE_BUF(pkt, blen); |
buf = AIT_GET_BUF(pkt); |
buf = AIT_GET_BUF(pkt); |
Line 298 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
Line 292 rpc_Read(int sock, int type, int flags, sockaddr_t * _
|
|
|
if (type == SOCK_BPF) |
if (type == SOCK_BPF) |
AIT_FREE_VAL(&v); |
AIT_FREE_VAL(&v); |
printf("exit from %s with ret=%d\n", __func__, ret); |
|
return ret; |
return ret; |
} |
} |
|
|