From 7aea691dfe1fb730ba40841e8c98e0541e1f2801 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Thu, 23 May 2013 12:50:08 +0200 Subject: [PATCH] relay: do not process headers after the first error Signed-off-by: Felix Fietkau --- relay.c | 4 +++- uhttpd.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/relay.c b/relay.c index 1b55d41..0540bd8 100644 --- a/relay.c +++ b/relay.c @@ -55,6 +55,7 @@ static void relay_error(struct relay *r) struct ustream *s = &r->sfd.stream; int len; + r->error = true; s->eof = true; ustream_get_read_buf(s, &len); if (len) @@ -118,7 +119,8 @@ static void relay_read_cb(struct ustream *s, int bytes) if (r->process_done) uloop_timeout_set(&r->timeout, 1); - relay_process_headers(r); + if (!r->error) + relay_process_headers(r); if (r->header_cb) { /* diff --git a/uhttpd.h b/uhttpd.h index 59f1565..0137eef 100644 --- a/uhttpd.h +++ b/uhttpd.h @@ -150,6 +150,7 @@ struct relay { struct client *cl; bool process_done; + bool error; int ret; int header_ofs; -- 2.11.0