Mercurial > hg > nginx
changeset 5561:35b00bcf72fe stable-1.4
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
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 29 Nov 2013 17:16:06 +0400 |
parents | fd77e2018652 |
children | 4196ea50004a |
files | src/event/ngx_event_openssl.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/event/ngx_event_openssl.c Thu Oct 31 18:23:49 2013 +0400 +++ b/src/event/ngx_event_openssl.c Fri Nov 29 17:16:06 2013 +0400 @@ -965,6 +965,7 @@ size -= n; if (size == 0) { + c->read->ready = 1; return bytes; } @@ -974,6 +975,10 @@ } if (bytes) { + if (c->ssl->last != NGX_AGAIN) { + c->read->ready = 1; + } + return bytes; }