From 35c80f98856d77dd0cf6bedbbb3e4041877d3e9d Mon Sep 17 00:00:00 2001 From: Andy Green Date: Sun, 23 Mar 2014 11:53:07 +0800 Subject: [PATCH] ssl add SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER to server and client gaby64 at githib found this option is necessary when using SSL with the truncated send support Signed-off-by: Andy Green --- lib/client.c | 3 +++ lib/server.c | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/client.c b/lib/client.c index 729e9b3..560603e 100644 --- a/lib/client.c +++ b/lib/client.c @@ -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 /* diff --git a/lib/server.c b/lib/server.c index 2f2c5b3..0178df2 100644 --- a/lib/server.c +++ b/lib/server.c @@ -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); -- 2.7.4