From 30cc8541cca61368dc2c5de7452a8dd5456308d7 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Thu, 13 Oct 2016 16:45:37 +0200 Subject: [PATCH] Allow non-empty lines after status code from a HTTP proxy. --- src/proxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/proxy.c b/src/proxy.c index e30c1fb..2b8f87c 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -256,7 +256,12 @@ int receive_proxy_meta(connection_t *c, int start, int lenin) { char *p = memchr(c->buffer, '\n', c->buflen); if(!p || p - c->buffer >= c->buflen) return 0; - p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer)); + + while(p = memchr(p + 1, '\n', c->buflen - (p + 1 - c->buffer))) { + if(p[-1] == '\n') + break; + } + if(!p) return 0; -- 2.25.1