]> git.kaiwu.me - nginx.git/commitdiff
backout r1757, we really need SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
authorIgor Sysoev <igor@sysoev.ru>
Thu, 31 Jan 2008 15:10:45 +0000 (15:10 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Thu, 31 Jan 2008 15:10:45 +0000 (15:10 +0000)
src/event/ngx_event_openssl.c

index edbb16fb87c009ba7cadfcc4c36e2927632fc93e..0c8b9d8edf4de29ff0f0fe142d15c59d5f9baac1 100644 (file)
@@ -187,6 +187,13 @@ ngx_ssl_create(ngx_ssl_t *ssl, ngx_uint_t protocols, void *data)
         SSL_CTX_set_options(ssl->ctx, ngx_ssl_protocols[protocols >> 1]);
     }
 
+    /*
+     * we need this option because in ngx_ssl_send_chain()
+     * we may switch to a buffered write and may copy leftover part of
+     * previously unbuffered data to our internal buffer
+     */
+    SSL_CTX_set_mode(ssl->ctx, SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
+
     SSL_CTX_set_read_ahead(ssl->ctx, 1);
 
     return NGX_OK;