Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 8321 invoked from network); 11 Apr 2009 19:49:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Apr 2009 19:49:34 -0000 Received: (qmail 48108 invoked by uid 500); 11 Apr 2009 19:49:34 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 48013 invoked by uid 500); 11 Apr 2009 19:49:33 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 48004 invoked by uid 99); 11 Apr 2009 19:49:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Apr 2009 19:49:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 11 Apr 2009 19:49:33 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0C43A23888E7; Sat, 11 Apr 2009 19:49:13 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r764239 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_ajp.c Date: Sat, 11 Apr 2009 19:49:12 -0000 To: cvs@httpd.apache.org From: rpluem@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090411194913.0C43A23888E7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: rpluem Date: Sat Apr 11 19:49:12 2009 New Revision: 764239 URL: http://svn.apache.org/viewvc?rev=764239&view=rev Log: * Check more strictly that the backend follows the AJP protocol. Submitted by: mturk Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=764239&r1=764238&r2=764239&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Sat Apr 11 19:49:12 2009 @@ -6,6 +6,9 @@ mod_proxy_ajp: Avoid delivering content from a previous request which failed to send a request body. PR 46949 [Ruediger Pluem] + *) mod_proxy_ajp: Check more strictly that the backend follows the AJP + protocol. [Mladen Turk] + *) mod_proxy_ajp: Forward remote port information by default. [Rainer Jung] Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?rev=764239&r1=764238&r2=764239&view=diff ============================================================================== --- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original) +++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Sat Apr 11 19:49:12 2009 @@ -180,6 +180,7 @@ int backend_failed = 0; apr_off_t bb_len; int data_sent = 0; + int request_ended = 0; int headers_sent = 0; int rv = 0; apr_int32_t conn_poll_fd; @@ -415,6 +416,15 @@ } break; case CMD_AJP13_SEND_HEADERS: + if (headers_sent) { + /* Do not send anything to the client. + * Backend already send us the headers. + */ + backend_failed = 1; + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: Backend sent headers twice."); + break; + } /* AJP13_SEND_HEADERS: process them */ status = ajp_parse_header(r, conf, conn->data); if (status != APR_SUCCESS) { @@ -480,6 +490,7 @@ } /* XXX: what about flush here? See mod_jk */ data_sent = 1; + request_ended = 1; break; default: backend_failed = 1; @@ -536,6 +547,17 @@ rv = DONE; } } + else if (!request_ended) { + ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, + "proxy: Processing of request didn't terminate cleanly"); + /* We had a failure: Close connection to backend */ + conn->close++; + backend_failed = 1; + /* Return DONE to avoid error messages being added to the stream */ + if (data_sent) { + rv = DONE; + } + } else { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: got response from %pI (%s)",