fixed SSL buffer usage

This commit is contained in:
Roberto De Ioris
2012-11-06 06:26:41 +01:00
parent 981ddfcefe
commit feac596efc
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -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) {
+8
View File
@@ -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;