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.
This commit is contained in:
parent
cff10910ad
commit
35d8088b44
|
@ -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);
|
LOG_TRACE("net_event() : fd=%d, ev=%d, arg=%p", con->sd, (int) event, arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (event == NET_EVENT_ERROR)
|
||||||
|
{
|
||||||
|
hub_disconnect_user(user->hub, user, quit_socket_error);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (event == NET_EVENT_TIMEOUT)
|
if (event == NET_EVENT_TIMEOUT)
|
||||||
{
|
{
|
||||||
if (user_is_connecting(user))
|
if (user_is_connecting(user))
|
||||||
|
|
Loading…
Reference in New Issue