]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Go a little faster by eliminating a sscanf() call when parsing response lines.
authorGuenter Knauf <fuankg@apache.org>
Wed, 6 Oct 2010 10:48:13 +0000 (10:48 +0000)
committerGuenter Knauf <fuankg@apache.org>
Wed, 6 Oct 2010 10:48:13 +0000 (10:48 +0000)
Backport r999694; AUthor: trawick, reviewed by: sf, wrowe.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1004983 13f79535-47bb-0310-9956-ffa450edef68

STATUS
modules/proxy/mod_proxy_http.c

diff --git a/STATUS b/STATUS
index 5ba53781368a22e0aba35c96f4b74c0c4ddc577b..36adefda2cddf891b5d3a37560d0b01a4adbaaed 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -129,12 +129,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
      2.2.x patch: http://people.apache.org/~trawick/fewerwarnings-2.txt
      +1: trawick, sf, wrowe
 
-   * mod_proxy_http: Go a little faster by eliminating a sscanf() call
-     when parsing response lines.
-     Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=999694
-     2.2.x patch: trunk patch works
-     +1: trawick, sf, wrowe
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 83d4e23a415da6ce3f17f7f1db875495b0496009..e0a8ae11168ecff2581dced7e991f7e83a08bc99 100644 (file)
@@ -1473,14 +1473,13 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
         if (apr_date_checkmask(buffer, "HTTP/#.# ###*")) {
             int major, minor;
 
-            if (2 != sscanf(buffer, "HTTP/%u.%u", &major, &minor)) {
-                major = 1;
-                minor = 1;
-            }
+            major = buffer[5] - '0';
+            minor = buffer[7] - '0';
+
             /* If not an HTTP/1 message or
              * if the status line was > 8192 bytes
              */
-            else if ((buffer[5] != '1') || (len >= sizeof(buffer)-1)) {
+            if ((major != 1) || (len >= sizeof(buffer)-1)) {
                 return ap_proxyerror(r, HTTP_BAD_GATEWAY,
                 apr_pstrcat(p, "Corrupt status line returned by remote "
                             "server: ", buffer, NULL));