mirror of
https://github.com/nginx/nginx.git
synced 2024-12-26 00:41:02 -06:00
SSL: improved ngx_ssl_recv_chain() to stop if c->read->ready is 0.
As long as there are data to read in the socket, yet the amount of data is less than total size of the buffers in the chain, this saves one unneeded read() syscall. Before this change, reading only stopped if ngx_ssl_recv() returned no data, that is, two read() syscalls in a row returned EAGAIN.
This commit is contained in:
parent
60609f2372
commit
d2ea226229
@ -1922,6 +1922,10 @@ ngx_ssl_recv_chain(ngx_connection_t *c, ngx_chain_t *cl, off_t limit)
|
||||
last += n;
|
||||
bytes += n;
|
||||
|
||||
if (!c->read->ready) {
|
||||
return bytes;
|
||||
}
|
||||
|
||||
if (last == b->end) {
|
||||
cl = cl->next;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user