You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mi...@apache.org on 2013/05/14 22:17:00 UTC

svn commit: r1482555 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

Author: minfrin
Date: Tue May 14 20:16:59 2013
New Revision: 1482555

URL: http://svn.apache.org/r1482555
Log:
mod_proxy: Make sure we skip empty tokens when parsing the Connection
header.

Modified:
    httpd/httpd/trunk/modules/proxy/proxy_util.c

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1482555&r1=1482554&r2=1482555&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Tue May 14 20:16:59 2013
@@ -2982,8 +2982,11 @@ static int find_conn_headers(void *data,
     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,
             elt = apr_array_push(x->array);
             *elt = name;
         }
-        while (*val == ',') {
-            ++val;
-        }
-        name = ap_get_token(x->pool, &val, 0);
-    }
+    } while (*val);
+
     return 1;
 }