mirror of
https://github.com/clearlinux/uwsgi.git
synced 2026-08-19 12:06:36 +00:00
fixed SSL buffer usage
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user