Skip to content

Commit

Permalink
Only listening tcp's should be polled.
Browse files Browse the repository at this point in the history
Fixes segfault with HttpServer::shutdown();
  • Loading branch information
slav-at-attachix committed Nov 8, 2017
1 parent 603d268 commit a6338c5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sming/SmingCore/Network/TcpConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ void TcpConnection::close()
axl_free(tcp);
#endif

tcp_poll(tcp, staticOnPoll, 1);
if(tcp->state == LISTEN) {
tcp_poll(tcp, staticOnPoll, 1);
}
tcp_arg(tcp, NULL); // reset pointer to close connection on next callback
tcp = NULL;

Expand Down

0 comments on commit a6338c5

Please sign in to comment.