Skip to content

Commit

Permalink
fix private connection leak
Browse files Browse the repository at this point in the history
  • Loading branch information
fortrue committed Jun 15, 2019
1 parent dacf3fb commit ace6ed2
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 ace6ed2

Please sign in to comment.