https + large-file sending, sometimes fails

Igor Sysoev is at rambler-co.ru
Thu Dec 20 13:40:09 MSK 2007


On Thu, Dec 20, 2007 at 01:30:50PM +0300, Igor Sysoev wrote:

> On Thu, Dec 20, 2007 at 01:16:19PM +0300, Igor Sysoev wrote:
> 
> > On Thu, Dec 20, 2007 at 10:55:16AM +0100, G?bor Farkas wrote:
> > 
> > > also, something i say by the testing: if you start to do a lot of 
> > > concurrent requests, and start to kill the clients (which are fetching 
> > > the file), then also other requests start to die more frequently then 
> > > normally.
> > 
> > Thank you, I have just reproduce the case.
> 
> The attached patch should fix the bug.

The complete patch.


-- 
Igor Sysoev
http://sysoev.ru/en/
-------------- next part --------------
Index: src/event/ngx_event_openssl.c
===================================================================
--- src/event/ngx_event_openssl.c	(revision 1073)
+++ src/event/ngx_event_openssl.c	(working copy)
@@ -404,6 +404,8 @@
     int        n, sslerr;
     ngx_err_t  err;
 
+    ERR_clear_error();
+
     n = SSL_do_handshake(c->ssl->connection);
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_do_handshake: %d", n);
@@ -605,6 +607,8 @@
 
     bytes = 0;
 
+    ERR_clear_error();
+
     /*
      * SSL_read() may return data in parts, so try to read
      * until SSL_read() would return no data
@@ -897,6 +901,8 @@
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL to write: %d", size);
 
+    ERR_clear_error();
+
     n = SSL_write(c->ssl->connection, data, size);
 
     ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0, "SSL_write: %d", n);
@@ -1002,6 +1008,8 @@
     again = 0;
     sslerr = 0;
 
+    ERR_clear_error();
+
     for ( ;; ) {
         n = SSL_shutdown(c->ssl->connection);
 


More information about the nginx mailing list