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

non ssl on ssl port fixes

As found by 'github user 7'

https://github.com/warmcat/libwebsockets/issues/338

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2015-10-31 06:49:05 +08:00
parent a42ac7b1fb
commit cc64fb535b

View file

@ -633,8 +633,10 @@ lws_server_socket_service_ssl(struct libwebsocket_context *context,
wsi->ssl = NULL;
goto accepted;
}
if (n == 0 || LWS_ERRNO == LWS_EAGAIN ||
LWS_ERRNO == LWS_EWOULDBLOCK) {
if (!n) /* connection is gone */
goto fail;
if (n < 0 && (LWS_ERRNO == LWS_EAGAIN ||
LWS_ERRNO == LWS_EWOULDBLOCK)) {
/*
* well, we get no way to know ssl or not
* so go around again waiting for something