diff --git a/plugins/http/http.c b/plugins/http/http.c index 056495b0..a960e1bc 100644 --- a/plugins/http/http.c +++ b/plugins/http/http.c @@ -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;