fix invalid packet

This commit is contained in:
yihaoDeng 2022-08-18 13:55:56 +08:00
parent 4dc5df8453
commit f3ec1593bc
1 changed files with 3 additions and 3 deletions

View File

@ -265,10 +265,10 @@ static bool uvHandleReq(SSvrConn* pConn) {
} }
void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) { void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
// opt SSvrConn* conn = cli->data;
SSvrConn* conn = cli->data; STrans* pTransInst = conn->pTransInst;
SConnBuffer* pBuf = &conn->readBuf; SConnBuffer* pBuf = &conn->readBuf;
STrans* pTransInst = conn->pTransInst;
if (nread > 0) { if (nread > 0) {
pBuf->len += nread; pBuf->len += nread;
tTrace("%s conn %p total read:%d, current read:%d", transLabel(pTransInst), conn, pBuf->len, (int)nread); tTrace("%s conn %p total read:%d, current read:%d", transLabel(pTransInst), conn, pBuf->len, (int)nread);