]> git.kaiwu.me - nginx.git/commitdiff
SSL: calculation of buffer size moved closer to its usage.
authorValentin Bartenev <vbart@nginx.com>
Mon, 28 Jan 2013 15:38:36 +0000 (15:38 +0000)
committerValentin Bartenev <vbart@nginx.com>
Mon, 28 Jan 2013 15:38:36 +0000 (15:38 +0000)
No functional changes.

src/event/ngx_event_openssl.c

index 362b0f73ad84371837d6b7e0ac7e835dfb8e6501..c27dba91c096c7ec7cef8b9d7d0bfcdbff5cbd45 100644 (file)
@@ -1207,12 +1207,12 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
             }
         }
 
-        size = buf->last - buf->pos;
-
         if (!flush && send < limit && buf->last < buf->end) {
             break;
         }
 
+        size = buf->last - buf->pos;
+
         n = ngx_ssl_write(c, buf->pos, size);
 
         if (n == NGX_ERROR) {