From d21bdf4dea3c17dede920ac1e5da1f95669b7a30 Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Tue, 14 May 2013 20:16:59 +0000 Subject: [PATCH] mod_proxy: Make sure we skip empty tokens when parsing the Connection header. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1482555 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 2b2eb8296e..82c2cd02c7 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -2982,8 +2982,11 @@ static int find_conn_headers(void *data, const char *key, const char *val) header_connection *x = data; const char *name; - name = ap_get_token(x->pool, &val, 0); - while (name && *name) { + do { + while (*val == ',') { + val++; + } + name = ap_get_token(x->pool, &val, 0); if (!strcasecmp(name, "close")) { x->closed = 1; } @@ -2998,11 +3001,8 @@ static int find_conn_headers(void *data, const char *key, const char *val) elt = apr_array_push(x->array); *elt = name; } - while (*val == ',') { - ++val; - } - name = ap_get_token(x->pool, &val, 0); - } + } while (*val); + return 1; } -- 2.50.1