Commit 7c8c4264 authored by Anjo Vahldiek's avatar Anjo Vahldiek
Browse files

updated connection

parent cd5cae17
......@@ -349,13 +349,15 @@ tcpsconn::process_accept()
// garbage collect all dead connections with refcount of 1
std::map<int, connection *>::iterator i;
for (i = conns_.begin(); i != conns_.end(); i++) {
for (i = conns_.begin(); i != conns_.end(); ) {
if (i->second->isdead() && i->second->ref() == 1) {
jsl_log(JSL_DBG_2, "accept_loop garbage collected fd=%d\n",
i->second->channo());
i->second->decref();
conns_.erase(i);
}
conns_.erase(i++);
}
else
i++;
}
conns_[ch->channo()] = ch;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment