fix rpc except
This commit is contained in:
parent
24042ffffa
commit
b555b6e4de
|
@ -573,8 +573,7 @@ static void cliRecvCb(uv_stream_t* handle, ssize_t nread, const uv_buf_t* buf) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (nread < 0) {
|
if (nread < 0) {
|
||||||
tWarn("%s conn %p read error:%s, ref:%d", CONN_GET_INST_LABEL(conn), conn, uv_err_name(nread),
|
tWarn("%s conn %p read error:%s, ref:%d", CONN_GET_INST_LABEL(conn), conn, uv_err_name(nread), T_REF_VAL_GET(conn));
|
||||||
T_REF_VAL_GET(conn));
|
|
||||||
conn->broken = true;
|
conn->broken = true;
|
||||||
cliHandleExcept(conn);
|
cliHandleExcept(conn);
|
||||||
}
|
}
|
||||||
|
@ -650,7 +649,11 @@ static bool cliHandleNoResp(SCliConn* conn) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
static void cliSendCb(uv_write_t* req, int status) {
|
static void cliSendCb(uv_write_t* req, int status) {
|
||||||
SCliConn* pConn = req->data;
|
SCliConn* pConn = req && req->handle ? req->handle->data : NULL;
|
||||||
|
taosMemoryFree(req);
|
||||||
|
if (pConn == NULL) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (status == 0) {
|
if (status == 0) {
|
||||||
tTrace("%s conn %p data already was written out", CONN_GET_INST_LABEL(pConn), pConn);
|
tTrace("%s conn %p data already was written out", CONN_GET_INST_LABEL(pConn), pConn);
|
||||||
|
@ -708,8 +711,8 @@ void cliSend(SCliConn* pConn) {
|
||||||
CONN_SET_PERSIST_BY_APP(pConn);
|
CONN_SET_PERSIST_BY_APP(pConn);
|
||||||
}
|
}
|
||||||
|
|
||||||
pConn->writeReq.data = pConn;
|
uv_write_t* req = taosMemoryCalloc(1, sizeof(uv_write_t));
|
||||||
uv_write(&pConn->writeReq, (uv_stream_t*)pConn->stream, &wb, 1, cliSendCb);
|
uv_write(req, (uv_stream_t*)pConn->stream, &wb, 1, cliSendCb);
|
||||||
return;
|
return;
|
||||||
_RETURN:
|
_RETURN:
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue