ssl add SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER to server and client
authorAndy Green <andy.green@linaro.org>
Sun, 23 Mar 2014 03:53:07 +0000 (11:53 +0800)
committerAndy Green <andy.green@linaro.org>
Sun, 23 Mar 2014 03:53:07 +0000 (11:53 +0800)
gaby64 at githib found this option is necessary when using SSL with the
truncated send support

Signed-off-by: Andy Green <andy.green@linaro.org>
lib/client.c
lib/server.c

index 729e9b3..560603e 100644 (file)
@@ -125,6 +125,9 @@ int lws_client_socket_service(struct libwebsocket_context *context,
                if (wsi->use_ssl && !wsi->ssl) {
 
                        wsi->ssl = SSL_new(context->ssl_client_ctx);
+                       SSL_set_mode(wsi->ssl,
+                                       SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
 
 #ifdef USE_CYASSL
                        /*
index 2f2c5b3..0178df2 100644 (file)
@@ -301,6 +301,7 @@ int lws_server_socket_service(struct libwebsocket_context *context,
                        openssl_websocket_private_data_index, context);
 
                SSL_set_fd(new_wsi->ssl, accept_fd);
+               SSL_set_mode(new_wsi->ssl, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
 
                #ifdef USE_CYASSL
                CyaSSL_set_using_nonblock(new_wsi->ssl, 1);