ssl fix excessive crash workaround

Signed-off-by: Andy Green <andy.green@linaro.org>
This commit is contained in:
Andy Green 2014-08-10 09:50:42 +08:00
parent a40760a2de
commit 62824f96d4
2 changed files with 8 additions and 4 deletions

View file

@ -731,10 +731,9 @@ int lws_server_socket_service(struct libwebsocket_context *context,
break;
}
if (new_wsi)
if (lws_server_socket_service_ssl(context, &wsi, new_wsi,
accept_fd, pollfd))
goto fail;
if (lws_server_socket_service_ssl(context, &wsi, new_wsi,
accept_fd, pollfd))
goto fail;
return 0;

View file

@ -445,6 +445,11 @@ lws_server_socket_service_ssl(struct libwebsocket_context *context,
switch (wsi->mode) {
case LWS_CONNMODE_SERVER_LISTENER:
if (!new_wsi) {
lwsl_err("no new_wsi\n");
return 0;
}
new_wsi->ssl = SSL_new(context->ssl_ctx);
if (new_wsi->ssl == NULL) {
lwsl_err("SSL_new failed: %s\n",