1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

Detect dead socket on iOS when server closed connection

This commit is contained in:
Sergio Hernández 2017-12-21 18:18:56 +08:00 committed by Andy Green
parent e8e448df3e
commit f3c6fac3cb

View file

@ -226,7 +226,7 @@ lws_ssl_capable_read(struct lws *wsi, unsigned char *buf, int len)
lwsl_debug("%p: SSL_read says %d\n", wsi, n);
/* manpage: returning 0 means connection shut down */
if (!n) {
if (!n || (n == -1 && errno == ENOTCONN)) {
wsi->socket_is_permanently_unusable = 1;
return LWS_SSL_CAPABLE_ERROR;