diff --git a/lib/private-libwebsockets.h b/lib/private-libwebsockets.h index b34e8402..ee5f1754 100644 --- a/lib/private-libwebsockets.h +++ b/lib/private-libwebsockets.h @@ -267,6 +267,7 @@ enum pending_timeout { PENDING_TIMEOUT_CLOSE_ACK, PENDING_TIMEOUT_AWAITING_EXTENSION_CONNECT_RESPONSE, PENDING_TIMEOUT_SENT_CLIENT_HANDSHAKE, + PENDING_TIMEOUT_SSL_ACCEPT, }; diff --git a/lib/server.c b/lib/server.c index 5fdccbbc..03c0a265 100644 --- a/lib/server.c +++ b/lib/server.c @@ -291,6 +291,9 @@ int lws_server_socket_service(struct libwebsocket_context *context, wsi->mode = LWS_CONNMODE_SSL_ACK_PENDING; insert_wsi_socket_into_fds(context, wsi); + libwebsocket_set_timeout(wsi, PENDING_TIMEOUT_SSL_ACCEPT, + AWAITING_TIMEOUT); + lwsl_info("inserted SSL acceipt into fds, trying actual SSL_accept\n"); /* fallthru */ @@ -340,6 +343,8 @@ int lws_server_socket_service(struct libwebsocket_context *context, /* OK, we are accepted */ + libwebsocket_set_timeout(wsi, NO_PENDING_TIMEOUT, 0); + wsi->mode = LWS_CONNMODE_HTTP_SERVING; lwsl_debug("accepted new SSL conn "