Do not get stuck processing HTTP requests, found by Thorduri

This commit is contained in:
Joris Vink 2013-11-25 14:21:47 +01:00
parent 97c67f7cfb
commit 6f311a06cf
1 changed files with 2 additions and 7 deletions

View File

@ -193,11 +193,6 @@ net_recv(struct connection *c)
r = SSL_get_error(c->ssl, r);
switch (r) {
case SSL_ERROR_WANT_READ:
c->flags &= ~CONN_READ_POSSIBLE;
if (nb->flags & NETBUF_CALL_CB_ALWAYS &&
nb->s_off > 0)
goto handle;
return (KORE_RESULT_OK);
case SSL_ERROR_WANT_WRITE:
c->flags &= ~CONN_READ_POSSIBLE;
return (KORE_RESULT_OK);
@ -208,8 +203,8 @@ net_recv(struct connection *c)
}
nb->s_off += (size_t)r;
if (nb->s_off == nb->b_len) {
handle:
if (nb->s_off == nb->b_len ||
(nb->flags & NETBUF_CALL_CB_ALWAYS)) {
r = nb->cb(nb);
if (nb->s_off == nb->b_len ||
(nb->flags & NETBUF_FORCE_REMOVE)) {