refactor rpc code

This commit is contained in:
yihaoDeng 2022-08-19 10:25:16 +08:00
parent 240747abed
commit 06c8d14f99
1 changed files with 3 additions and 4 deletions

View File

@ -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;
} }