Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 87834 invoked from network); 3 Nov 2008 18:54:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Nov 2008 18:54:07 -0000 Received: (qmail 16279 invoked by uid 500); 3 Nov 2008 18:54:05 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 16212 invoked by uid 500); 3 Nov 2008 18:54:05 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 16201 invoked by uid 99); 3 Nov 2008 18:54:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Nov 2008 10:54:05 -0800 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; Mon, 03 Nov 2008 18:52:57 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9A70C238889E; Mon, 3 Nov 2008 10:53:38 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r710125 - in /tomcat/trunk/java/org/apache/catalina: connector/Response.java core/StandardHostValve.java Date: Mon, 03 Nov 2008 18:53:38 -0000 To: dev@tomcat.apache.org From: markt@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081103185338.9A70C238889E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: markt Date: Mon Nov 3 10:53:37 2008 New Revision: 710125 URL: http://svn.apache.org/viewvc?rev=710125&view=rev Log: As per Remy's review comment, make sure we continue to reset the writer/stream flags before forwarding to a custom error page. Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Modified: tomcat/trunk/java/org/apache/catalina/connector/Response.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/Response.java?rev=710125&r1=710124&r2=710125&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/connector/Response.java (original) +++ tomcat/trunk/java/org/apache/catalina/connector/Response.java Mon Nov 3 10:53:37 2008 @@ -670,16 +670,38 @@ * been committed */ public void resetBuffer() { + resetBuffer(false); + } + + + /** + * Reset the data buffer and the using Writer/Stream flags but not any + * status or header information. + * + * @param resetWriterStreamFlags true if the internal + * usingWriter, usingOutputStream, + * isCharacterEncodingSet flags should also be reset + * + * @exception IllegalStateException if the response has already + * been committed + */ + public void resetBuffer(boolean resetWriterStreamFlags) { if (isCommitted()) throw new IllegalStateException (sm.getString("coyoteResponse.resetBuffer.ise")); outputBuffer.reset(); + + if(resetWriterStreamFlags) { + usingOutputStream = false; + usingWriter = false; + isCharacterEncodingSet = false; + } } - + /** * Set the buffer size to be used for this Response. * Modified: tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java?rev=710125&r1=710124&r2=710125&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java (original) +++ tomcat/trunk/java/org/apache/catalina/core/StandardHostValve.java Mon Nov 3 10:53:37 2008 @@ -406,7 +406,7 @@ try { // Reset the response (keeping the real error code and message) - response.resetBuffer(); + response.resetBuffer(true); // Forward control to the specified location ServletContext servletContext = --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org