Close meta connection socket after cleaning up event structures.
Epoll doesn't like it when an already closed filedescriptor is being removed, so we defer closing the socket until after all else is cleaned up.
This commit is contained in:
parent
30ef2a981e
commit
d1cd3c8145
2 changed files with 3 additions and 3 deletions
|
@ -87,6 +87,9 @@ void free_connection(connection_t *c) {
|
|||
if(event_initialized(&c->outevent))
|
||||
event_del(&c->outevent);
|
||||
|
||||
if(c->socket > 0)
|
||||
closesocket(c->socket);
|
||||
|
||||
free(c);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,9 +116,6 @@ void terminate_connection(connection_t *c, bool report) {
|
|||
if(c->node)
|
||||
c->node->connection = NULL;
|
||||
|
||||
if(c->socket)
|
||||
closesocket(c->socket);
|
||||
|
||||
if(c->edge) {
|
||||
if(report && !tunnelserver)
|
||||
send_del_edge(broadcast, c->edge);
|
||||
|
|
Loading…
Reference in a new issue