fix headers parsing in http router

This commit is contained in:
Unbit
2014-04-06 10:15:24 +02:00
parent b0065c379e
commit 4f8c41cf61
+3 -3
View File
@@ -685,9 +685,6 @@ ssize_t http_parse(struct corerouter_peer *main_peer) {
struct corerouter_session *cs = main_peer->session;
struct http_session *hr = (struct http_session *) cs;
// ensure the headers timeout is honoured
http_set_timeout(main_peer, uhttp.headers_timeout);
// is it http body ?
if (hr->rnrn == 4) {
// something bad happened in keepalive mode...
@@ -722,6 +719,9 @@ ssize_t http_parse(struct corerouter_peer *main_peer) {
return 1;
}
// ensure the headers timeout is honoured
http_set_timeout(main_peer, uhttp.headers_timeout);
// read until \r\n\r\n is found
size_t j;
size_t len = main_peer->in->pos;