提交 4f7886d2 编写于 作者: dengyihao's avatar dengyihao

fix(rpc): avoid fd leak

上级 dd8e642f
...@@ -363,6 +363,10 @@ void uvOnSendCb(uv_write_t* req, int status) { ...@@ -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) { ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册