Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 25761 invoked from network); 6 Jul 2003 06:16:08 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 6 Jul 2003 06:16:08 -0000 Received: (qmail 29319 invoked by uid 97); 6 Jul 2003 06:18:45 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@nagoya.betaversion.org Received: (qmail 29312 invoked from network); 6 Jul 2003 06:18:45 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 6 Jul 2003 06:18:45 -0000 Received: (qmail 24951 invoked by uid 500); 6 Jul 2003 06:16:02 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 24938 invoked by uid 500); 6 Jul 2003 06:16:01 -0000 Received: (qmail 24935 invoked from network); 6 Jul 2003 06:16:01 -0000 Received: from icarus.apache.org (208.185.179.13) by daedalus.apache.org with SMTP; 6 Jul 2003 06:16:01 -0000 Received: (qmail 38935 invoked by uid 1385); 6 Jul 2003 06:16:00 -0000 Date: 6 Jul 2003 06:16:00 -0000 Message-ID: <20030706061600.38934.qmail@icarus.apache.org> From: billbarker@apache.org To: jakarta-tomcat-connectors-cvs@apache.org Subject: cvs commit: jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11 Http11Processor.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N billbarker 2003/07/05 23:16:00 Modified: http11/src/java/org/apache/coyote/http11 Http11Processor.java Log: Re-activate dropping the connection on serious protocol errors. Also adding Remy's suggestion to check the exception, as well as checking the status code in the commit so that we can be nice enough to tell the client that we're not talking to them anymore if we discover the error soon enough. Revision Changes Path 1.70 +13 -3 jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java Index: Http11Processor.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11Processor.java,v retrieving revision 1.69 retrieving revision 1.70 diff -u -r1.69 -r1.70 --- Http11Processor.java 5 Jul 2003 01:39:42 -0000 1.69 +++ Http11Processor.java 6 Jul 2003 06:16:00 -0000 1.70 @@ -635,9 +635,16 @@ thrA.setCurrentStage(threadPool, "service"); rp.setStage(org.apache.coyote.Constants.STAGE_SERVICE); adapter.service(request, response); - /* Mimic httpd (currently disabled) - error = statusDropsConnection(response.getStatus()); - */ + // Handle when the response was committed before a serious + // error occurred. Throwing a ServletException should both + // set the status to 500 and set the errorException. + // If we fail here, then the response is likely already + // committed, so we can't try and set headers. + if(keepAlive && !error) { // Avoid checking twice. + error = response.getErrorException() != null || + statusDropsConnection(response.getStatus()); + } + } catch (InterruptedIOException e) { error = true; } catch (Throwable t) { @@ -1260,6 +1267,9 @@ keepAlive = false; } + // If we know that the request is bad this early, add the + // Connection: close header. + keepAlive = keepAlive && statusDropsConnection(statusCode); if (!keepAlive) { response.addHeader("Connection", "close"); } else if (!http11) { --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org