https + large-file sending, sometimes fails

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


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.


-- 
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)
@@ -605,6 +605,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 +899,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);


More information about the nginx mailing list