fix invalid read
This commit is contained in:
parent
be412c3ca7
commit
919de857d2
|
@ -105,6 +105,7 @@ typedef struct SCliConn {
|
|||
|
||||
uv_buf_t* buf;
|
||||
int32_t bufSize;
|
||||
int32_t readerStart;
|
||||
|
||||
queue wq; // uv_write_t queue
|
||||
} SCliConn;
|
||||
|
@ -1178,8 +1179,12 @@ static void cliBatchSendCb(uv_write_t* req, int status) {
|
|||
}
|
||||
|
||||
cliConnMayUpdateTimer(conn, READ_TIMEOUT);
|
||||
|
||||
uv_read_start((uv_stream_t*)conn->stream, cliAllocRecvBufferCb, cliRecvCb);
|
||||
// if (!uv_is_readable(conn->stream)) {
|
||||
if (conn->readerStart == 0) {
|
||||
uv_read_start((uv_stream_t*)conn->stream, cliAllocRecvBufferCb, cliRecvCb);
|
||||
conn->readerStart = 1;
|
||||
}
|
||||
//}
|
||||
|
||||
if (!cliMayRecycleConn(conn)) {
|
||||
(void)cliBatchSend(conn);
|
||||
|
|
Loading…
Reference in New Issue