mirror of
https://github.com/nginx/nginx.git
synced 2025-06-07 17:52:38 +08:00
SSL: fixed c->read->ready handling in ngx_ssl_recv().
If c->read->ready was reset, but later some data were read from a socket buffer due to a call to ngx_ssl_recv(), the c->read->ready flag should be restored if not all data were read from OpenSSL buffers (as kernel won't notify us about the data anymore). More details are available here: http://mailman.nginx.org/pipermail/nginx/2013-November/041178.html
This commit is contained in:
parent
6b7e88f36b
commit
067c1d2a4f
@ -1025,6 +1025,7 @@ ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)
|
|||||||
size -= n;
|
size -= n;
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
|
c->read->ready = 1;
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1034,6 +1035,10 @@ ngx_ssl_recv(ngx_connection_t *c, u_char *buf, size_t size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (bytes) {
|
if (bytes) {
|
||||||
|
if (c->ssl->last != NGX_AGAIN) {
|
||||||
|
c->read->ready = 1;
|
||||||
|
}
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user