force client ssl bio nonblocking 72/2972/1
authorAndy Green <andy.green@linaro.org>
Mon, 28 Jan 2013 09:48:21 +0000 (17:48 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:29 +0000 (13:01 -0800)
Signed-off-by: Andy Green <andy.green@linaro.org>
lib/client.c

index abcd166..7a01a4a 100644 (file)
@@ -116,8 +116,11 @@ int lws_client_socket_service(struct libwebsocket_context *context, struct libwe
                        wsi->ssl = SSL_new(context->ssl_client_ctx);
                        wsi->client_bio = BIO_new_socket(wsi->sock,
                                                                   BIO_NOCLOSE);
+
                        SSL_set_bio(wsi->ssl, wsi->client_bio, wsi->client_bio);
 
+                       BIO_set_nbio(wsi->client_bio, 1); /* nonblocking */
+
                        SSL_set_ex_data(wsi->ssl,
                                        openssl_websocket_private_data_index,
                                                                       context);