Merge branch '3.0' into enh/opt-transport
This commit is contained in:
parent
c345383d5a
commit
12b560e6db
|
@ -371,19 +371,21 @@ void cliConnMayUpdateTimer(SCliConn* conn, int timeout) {
|
||||||
if (pInst->startReadTimer == 0) {
|
if (pInst->startReadTimer == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// reset previous timer
|
||||||
if (conn->timer != NULL) {
|
if (conn->timer != NULL) {
|
||||||
// reset previous timer
|
// reset previous timer
|
||||||
cliResetConnTimer(conn);
|
cliResetConnTimer(conn);
|
||||||
}
|
}
|
||||||
int32_t reqsSentNum = transQueueSize(&conn->reqsSentOut);
|
int32_t reqsSentNum = transQueueSize(&conn->reqsSentOut);
|
||||||
if (reqsSentNum == 0) {
|
if (reqsSentNum == 0) {
|
||||||
|
// no need to set timer
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (conn->timer == NULL) {
|
|
||||||
|
// start a new timer
|
||||||
if (cliGetConnTimer(conn->hostThrd, conn) != 0) {
|
if (cliGetConnTimer(conn->hostThrd, conn) != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
uv_timer_start(conn->timer, cliConnTimeout__checkReq, timeout, 0);
|
uv_timer_start(conn->timer, cliConnTimeout__checkReq, timeout, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue