diff --git a/plugins/corerouter/corerouter.c b/plugins/corerouter/corerouter.c index b4276197..cd1ac043 100644 --- a/plugins/corerouter/corerouter.c +++ b/plugins/corerouter/corerouter.c @@ -840,6 +840,8 @@ void uwsgi_corerouter_loop(int id, void *data) { continue; } + // reset errno (as we use it for internal signalling) + errno = 0; ssize_t ret = hook(cr_session); // connection closed if (ret == 0) { diff --git a/plugins/http/http.c b/plugins/http/http.c index 78694674..bcbfd55a 100644 --- a/plugins/http/http.c +++ b/plugins/http/http.c @@ -904,6 +904,14 @@ ssize_t hr_recv_http_ssl(struct corerouter_session * cs) { uwsgi_cr_hook_write(cs, NULL); uwsgi_cr_hook_read(cs, hr_recv_http_ssl); } + int ret2 = SSL_pending(hs->ssl); + if (ret2 > 0) { + if (uwsgi_buffer_fix(cs->buffer, cs->buffer->len + ret2 )) return -1; + if (SSL_read(hs->ssl, cs->buffer->buf + cs->buffer_pos + ret, ret2) != ret2) { + return -1; + } + ret += ret2; + } return hs_http_manage(cs, ret); } if (ret == 0) return 0;