Handle socket errors from connected clients.

If a TLS error occurs, it could end up in a situation where the network handler code did not want to
read or write because it only had the error flag set. However, this was not handled, which left the
socket triggering in the event loop - but nothing was done to handle it.

This can easily cause a 100% cpu situation - the hub is still functioning though while this is
happening.
pull/75/merge
Jan Vidar Krey 4 years ago
parent cff10910ad
commit 35d8088b44
  1. 6
      src/core/netevent.c

@ -137,6 +137,12 @@ void net_event(struct net_connection* con, int event, void *arg)
LOG_TRACE("net_event() : fd=%d, ev=%d, arg=%p", con->sd, (int) event, arg);
#endif
if (event == NET_EVENT_ERROR)
{
hub_disconnect_user(user->hub, user, quit_socket_error);
return;
}
if (event == NET_EVENT_TIMEOUT)
{
if (user_is_connecting(user))

Loading…
Cancel
Save