Mercurial > hg > nginx
comparison src/event/ngx_event_openssl.c @ 5450:9868c72f6f43
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 | 1356a3b96924 |
children | a297b7ad6f94 |
comparison
equal
deleted
inserted
replaced
5449:8f3cf6776648 | 5450:9868c72f6f43 |
---|---|
1023 if (c->ssl->last == NGX_OK) { | 1023 if (c->ssl->last == NGX_OK) { |
1024 | 1024 |
1025 size -= n; | 1025 size -= n; |
1026 | 1026 |
1027 if (size == 0) { | 1027 if (size == 0) { |
1028 c->read->ready = 1; | |
1028 return bytes; | 1029 return bytes; |
1029 } | 1030 } |
1030 | 1031 |
1031 buf += n; | 1032 buf += n; |
1032 | 1033 |
1033 continue; | 1034 continue; |
1034 } | 1035 } |
1035 | 1036 |
1036 if (bytes) { | 1037 if (bytes) { |
1038 if (c->ssl->last != NGX_AGAIN) { | |
1039 c->read->ready = 1; | |
1040 } | |
1041 | |
1037 return bytes; | 1042 return bytes; |
1038 } | 1043 } |
1039 | 1044 |
1040 switch (c->ssl->last) { | 1045 switch (c->ssl->last) { |
1041 | 1046 |