You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fu...@apache.org on 2010/10/06 12:48:13 UTC
svn commit: r1004983 - in /httpd/httpd/branches/2.2.x: STATUS
modules/proxy/mod_proxy_http.c
Author: fuankg
Date: Wed Oct 6 10:48:13 2010
New Revision: 1004983
URL: http://svn.apache.org/viewvc?rev=1004983&view=rev
Log:
Go a little faster by eliminating a sscanf() call when parsing response lines.
Backport r999694; AUthor: trawick, reviewed by: sf, wrowe.
Modified:
httpd/httpd/branches/2.2.x/STATUS
httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c
Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=1004983&r1=1004982&r2=1004983&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Wed Oct 6 10:48:13 2010
@@ -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 ]
Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c?rev=1004983&r1=1004982&r2=1004983&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c (original)
+++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c Wed Oct 6 10:48:13 2010
@@ -1473,14 +1473,13 @@ apr_status_t ap_proxy_http_process_respo
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));