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

Subject: [PATCH] On iOS with nonblocking sockets I experience SSL error which

is not really an error (
 http://lists.freeradius.org/pipermail/freeradius-users/2009-August/040155.html
 ). Added check for that. Additional fixes for comments and logging.
This commit is contained in:
shys 2013-10-25 15:52:47 +02:00 committed by Andy Green
parent 44e260e004
commit 6b5c1af439

View file

@ -196,16 +196,21 @@ int lws_client_socket_service(struct libwebsocket_context *context,
* retry if new data comes until we
* run into the connection timeout or win
*/
lwsl_err("SSL connect error %lu: %s\n",
ERR_get_error(),
ERR_error_string(ERR_get_error(),
(char *)context->service_buffer));
return 0;
n = ERR_get_error();
if (n != SSL_ERROR_NONE) {
lwsl_err("SSL connect error %lu: %s\n",
ERR_get_error(),
ERR_error_string(ERR_get_error(),
(char *)context->service_buffer));
return 0;
}
}
} else
wsi->ssl = NULL;
/* fallthru */
case LWS_CONNMODE_WS_CLIENT_WAITING_SSL:
if (wsi->use_ssl) {
@ -214,7 +219,7 @@ int lws_client_socket_service(struct libwebsocket_context *context,
lws_latency_pre(context, wsi);
n = SSL_connect(wsi->ssl);
lws_latency(context, wsi,
"SSL_connect LWS_CONNMODE_WS_CLIENT_ISSUE_HANDSHAKE",
"SSL_connect LWS_CONNMODE_WS_CLIENT_WAITING_SSL",
n, n > 0);
if (n < 0) {
@ -252,12 +257,14 @@ int lws_client_socket_service(struct libwebsocket_context *context,
* retry if new data comes until we
* run into the connection timeout or win
*/
lwsl_err("SSL connect error %lu: %s\n",
ERR_get_error(),
ERR_error_string(ERR_get_error(),
(char *)context->service_buffer));
return 0;
n = ERR_get_error();
if (n != SSL_ERROR_NONE) {
lwsl_err("SSL connect error %lu: %s\n",
ERR_get_error(),
ERR_error_string(ERR_get_error(),
(char *)context->service_buffer));
return 0;
}
}
}