[nginx] svn commit: r5021 - trunk/src/event

vbart at nginx.com vbart at nginx.com
Mon Jan 28 15:37:11 UTC 2013


Author: vbart
Date: 2013-01-28 15:37:11 +0000 (Mon, 28 Jan 2013)
New Revision: 5021
URL: http://trac.nginx.org/nginx/changeset/5021/nginx

Log:
SSL: preservation of flush flag for buffered data.

Previously, if SSL buffer was not sent we lost information that the data
must be flushed.



Modified:
   trunk/src/event/ngx_event_openssl.c

Modified: trunk/src/event/ngx_event_openssl.c
===================================================================
--- trunk/src/event/ngx_event_openssl.c	2013-01-28 15:35:12 UTC (rev 5020)
+++ trunk/src/event/ngx_event_openssl.c	2013-01-28 15:37:11 UTC (rev 5021)
@@ -1169,7 +1169,7 @@
     }
 
     send = 0;
-    flush = (in == NULL) ? 1 : 0;
+    flush = (in == NULL) ? 1 : buf->flush;
 
     for ( ;; ) {
 
@@ -1191,7 +1191,6 @@
 
             if (send + size > limit) {
                 size = (ssize_t) (limit - send);
-                flush = 1;
             }
 
             ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, 0,
@@ -1210,7 +1209,7 @@
 
         size = buf->last - buf->pos;
 
-        if (!flush && buf->last < buf->end) {
+        if (!flush && send < limit && buf->last < buf->end) {
             break;
         }
 
@@ -1221,8 +1220,7 @@
         }
 
         if (n == NGX_AGAIN) {
-            c->buffered |= NGX_SSL_BUFFERED;
-            return in;
+            break;
         }
 
         buf->pos += n;
@@ -1242,6 +1240,8 @@
         }
     }
 
+    buf->flush = flush;
+
     if (buf->pos < buf->last) {
         c->buffered |= NGX_SSL_BUFFERED;
 



More information about the nginx-devel mailing list