comparison src/event/ngx_event_openssl.c @ 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 bebcc2f837d3
children 70f4d99ded41
comparison
equal deleted inserted replaced
5560:fd77e2018652 5561:35b00bcf72fe
963 if (c->ssl->last == NGX_OK) { 963 if (c->ssl->last == NGX_OK) {
964 964
965 size -= n; 965 size -= n;
966 966
967 if (size == 0) { 967 if (size == 0) {
968 c->read->ready = 1;
968 return bytes; 969 return bytes;
969 } 970 }
970 971
971 buf += n; 972 buf += n;
972 973
973 continue; 974 continue;
974 } 975 }
975 976
976 if (bytes) { 977 if (bytes) {
978 if (c->ssl->last != NGX_AGAIN) {
979 c->read->ready = 1;
980 }
981
977 return bytes; 982 return bytes;
978 } 983 }
979 984
980 switch (c->ssl->last) { 985 switch (c->ssl->last) {
981 986