refactor rpc code
This commit is contained in:
parent
240747abed
commit
06c8d14f99
|
@ -275,16 +275,15 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
|
||||||
if (pBuf->len <= TRANS_PACKET_LIMIT) {
|
if (pBuf->len <= TRANS_PACKET_LIMIT) {
|
||||||
while (transReadComplete(pBuf)) {
|
while (transReadComplete(pBuf)) {
|
||||||
tTrace("%s conn %p alread read complete packet", transLabel(pTransInst), conn);
|
tTrace("%s conn %p alread read complete packet", transLabel(pTransInst), conn);
|
||||||
if (pBuf->invalid) {
|
if (true == pBuf->invalid || false == uvHandleReq(conn)) {
|
||||||
tTrace("%s conn %p alread read invalid packet", transLabel(pTransInst), conn);
|
tError("%s conn %p read invalid packet", transLabel(pTransInst), conn);
|
||||||
destroyConn(conn, true);
|
destroyConn(conn, true);
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
if (false == uvHandleReq(conn)) break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
tError("%s conn %p read invalid packet, exceed limit", transLabel(pTransInst), conn);
|
||||||
destroyConn(conn, true);
|
destroyConn(conn, true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue