Skip to content

Commit

Permalink
Merge pull request #101 from joyieldInc/FixPrivateConnLeak
Browse files Browse the repository at this point in the history
fix private connection leak
  • Loading branch information
fortrue authored Feb 1, 2020
2 parents dacf3fb + ace6ed2 commit 393ff81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ void Handler::postAcceptConnectionEvent()
auto cp = mConnPool[s->server()->id()];
s->setStatus(Connection::LogicError);
addPostEvent(s, Multiplexor::ErrorEvent);
cp->putPrivateConnection(s);
c->detachConnectConnection();
s->detachAcceptConnection();
}
Expand Down Expand Up @@ -276,6 +275,9 @@ void Handler::postConnectConnectionEvent()
s->status(), s->statusStr());
mEventLoop->delSocket(s);
s->close(this);
if (!s->isShared()) {
mConnPool[s->server()->id()]->putPrivateConnection(s);
}
if (c) {
addPostEvent(c, Multiplexor::ErrorEvent);
s->detachAcceptConnection();
Expand Down

0 comments on commit 393ff81

Please sign in to comment.