websockets: handel SSL_AGAIN in non-connecting state

While it is harder to properly andle SSL_AGAIN in states other than
WS_CONNECTING first ssl_read is the same, so at least handle it
properly.
This commit is contained in:
Artem Savkov 2018-11-14 19:47:21 +01:00
parent 10073221cc
commit 2aec1fc456
1 changed files with 2 additions and 0 deletions

View File

@ -208,6 +208,8 @@ static gboolean discord_ws_in_cb(gpointer data, int source,
gboolean disconnected;
if (ssl_read(dd->ssl, &buf, 1) < 1) {
if (ssl_errno == SSL_AGAIN)
return TRUE;
imcb_error(ic, "Failed to read ws header.");
discord_ws_reconnect(ic);
return FALSE;