SSL: take into account data in the buffer while limiting output.

In some rare cases this can result in a more smooth sending rate.
This commit is contained in:
Valentin Bartenev 2013-01-28 15:41:12 +00:00
parent bfe4ae8a88
commit 5ef334fff4

View 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 ( ;; ) {