Commit 95640189 authored by Guenter Knauf's avatar Guenter Knauf
Browse files

Go a little faster by eliminating a sscanf() call when parsing response lines.

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
parent f9cc038c
Loading
Loading
Loading
Loading
+0 −6
Changes for STATUS: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -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 ]
+4 −5
Changes for modules/proxy/mod_proxy_http.c: 4 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -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));