From: Felix Fietkau Date: Thu, 23 May 2013 10:50:08 +0000 (+0200) Subject: relay: do not process headers after the first error X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7aea691dfe1fb730ba40841e8c98e0541e1f2801;p=oweals%2Fuhttpd.git relay: do not process headers after the first error Signed-off-by: Felix Fietkau --- 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;