From: Joe Orton Date: Tue, 2 Dec 2003 14:38:41 +0000 (+0000) Subject: Backport from HEAD: X-Git-Tag: 2.0.49~327 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=82574ba481bb98cee7e3dc88379b736fbee76433;p=thirdparty%2Fapache%2Fhttpd.git Backport from HEAD: * proxy_http.c (ap_proxy_http_process_response): Send a valid status-line even if the parsed status-line had no trailing spaces. Remove the warning for this case as triggers for valid status-lines too. PR: 23998 Reviewed by: Jeff Trawick, Bill Stoddard git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@101954 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index 8dc63159c6c..c29748448dd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.49 + *) mod_proxy: Fix cases where an invalid status-line could be sent + to the client. PR 23998. [Joe Orton] + *) mod_ssl: Fix segfaults at startup if other modules which use OpenSSL are also loaded. [Joe Orton] diff --git a/STATUS b/STATUS index 18d6c8c9409..fa21d49c665 100644 --- a/STATUS +++ b/STATUS @@ -1,5 +1,5 @@ APACHE 2.0 STATUS: -*-text-*- -Last modified at [$Date: 2003/12/02 14:23:23 $] +Last modified at [$Date: 2003/12/02 14:38:40 $] Release: @@ -80,15 +80,6 @@ PATCHES TO BACKPORT FROM 2.1 +1: stoddard +1 (concept): trawick (looks reasonable when compared with worker) - * Prevent mod_proxy from sending an invalid status-line to clients - in some cases. - modules/proxy/proxy_http.c: r1.172 - +1: jorton, trawick, stoddard - trawick: whoever merges this please create CHANGES entry in both - "trees" and reference PR 18573; oops, Joe thought he - was solving 23998 :) So close the extra one as a dup - of whichever one gets listed in CHANGES - * Fix timezone handling in mod_log_config. PR 23642 modules/loggers/mod_log_config.c: r1.107 +1: jorton, stoddard, trawick diff --git a/modules/proxy/proxy_http.c b/modules/proxy/proxy_http.c index 53a5793b98e..634f5438458 100644 --- a/modules/proxy/proxy_http.c +++ b/modules/proxy/proxy_http.c @@ -756,16 +756,18 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, backasswards = 0; keepchar = buffer[12]; - if (keepchar == '\0') { - ap_log_error(APLOG_MARK, APLOG_WARNING, 0, - r->server, "proxy: bad HTTP/%d.%d status line " - "returned by %s (%s)", major, minor, r->uri, - r->method); - } buffer[12] = '\0'; r->status = atoi(&buffer[9]); - buffer[12] = keepchar; + if (keepchar != '\0') { + buffer[12] = keepchar; + } else { + /* 2616 requires the space in Status-Line; the origin + * server may have sent one but ap_rgetline_core will + * have stripped it. */ + buffer[12] = ' '; + buffer[13] = '\0'; + } r->status_line = apr_pstrdup(p, &buffer[9]);