]> git.kaiwu.me - nginx.git/commitdiff
SSL: take into account data in the buffer while limiting output.
authorValentin Bartenev <vbart@nginx.com>
Mon, 28 Jan 2013 15:41:12 +0000 (15:41 +0000)
committerValentin Bartenev <vbart@nginx.com>
Mon, 28 Jan 2013 15:41:12 +0000 (15:41 +0000)
In some rare cases this can result in a more smooth sending rate.

src/event/ngx_event_openssl.c

index d288bc817675ef60fbff720e9d410cf828021cfa..1a1498cae99efc2f607177f5254db59557a31e94 100644 (file)
@@ -1168,7 +1168,7 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
         buf->end = buf->start + NGX_SSL_BUFSIZE;
     }
 
-    send = 0;
+    send = buf->last - buf->pos;
     flush = (in == NULL) ? 1 : buf->flush;
 
     for ( ;; ) {