fix(rpc): avoid fd leak
This commit is contained in:
parent
dd8e642f37
commit
4f7886d208
|
@ -363,6 +363,10 @@ void uvOnSendCb(uv_write_t* req, int status) {
|
||||||
if (msg->type == Release && conn->status != ConnNormal) {
|
if (msg->type == Release && conn->status != ConnNormal) {
|
||||||
conn->status = ConnNormal;
|
conn->status = ConnNormal;
|
||||||
transUnrefSrvHandle(conn);
|
transUnrefSrvHandle(conn);
|
||||||
|
reallocConnRefHandle(conn);
|
||||||
|
destroySmsg(msg);
|
||||||
|
transQueueClear(&conn->srvMsgs);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
destroySmsg(msg);
|
destroySmsg(msg);
|
||||||
// send second data, just use for push
|
// send second data, just use for push
|
||||||
|
@ -973,7 +977,7 @@ void uvHandleQuit(SSrvMsg* msg, SWorkThrdObj* thrd) {
|
||||||
}
|
}
|
||||||
void uvHandleRelease(SSrvMsg* msg, SWorkThrdObj* thrd) {
|
void uvHandleRelease(SSrvMsg* msg, SWorkThrdObj* thrd) {
|
||||||
SSrvConn* conn = msg->pConn;
|
SSrvConn* conn = msg->pConn;
|
||||||
reallocConnRefHandle(conn);
|
// reallocConnRefHandle(conn);
|
||||||
if (conn->status == ConnAcquire) {
|
if (conn->status == ConnAcquire) {
|
||||||
if (!transQueuePush(&conn->srvMsgs, msg)) {
|
if (!transQueuePush(&conn->srvMsgs, msg)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue