Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 60095 invoked from network); 22 Apr 2003 08:47:30 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 22 Apr 2003 08:47:30 -0000 Received: (qmail 7473 invoked by uid 97); 22 Apr 2003 08:49:39 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@nagoya.betaversion.org Received: (qmail 7466 invoked from network); 22 Apr 2003 08:49:39 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 22 Apr 2003 08:49:39 -0000 Received: (qmail 59248 invoked by uid 500); 22 Apr 2003 08:47:19 -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 57460 invoked from network); 21 Apr 2003 23:37:27 -0000 Message-ID: From: Saravanan Bellan To: "'tomcat-dev@jakarta.apache.org'" Subject: [PATCH] - JTC - Http11Processor.java Date: Mon, 21 Apr 2003 16:37:33 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2656.59) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C3085E.E3F781A4" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N ------_=_NextPart_000_01C3085E.E3F781A4 Content-Type: text/plain; charset="iso-8859-1" -----Original Message----- From: Saravanan Bellan Sent: Tuesday, April 15, 2003 7:09 PM To: 'tomcat-user@jakarta.apache.org' Subject: [PATCH] - JTC - Http11Processor.java This is a fix when the content-length is invalid or greater than Integer.MAX_VALUE. What was happening was when such a condition happens the Http11Processor exits abruptly leaving a dirty Request object(which has the invalid content length) and when the Request object is used for any futher request , the same exception is returned. To reproduce send a request with content-length < 0 or > Integer.MAX_VALUE. Also, is there any proposal for the Changing the content length in the Servlet specification from Integer to Long? Thanks, The following patch is also attached with the mail. Index: Http11Processor.java =================================================================== RCS file: /home/cvspublic/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/ http11/Http11Processor.java,v retrieving revision 1.63 diff -u -r1.63 Http11Processor.java --- Http11Processor.java 23 Mar 2003 18:58:29 -0000 1.63 +++ Http11Processor.java 16 Apr 2003 01:52:57 -0000 @@ -959,11 +959,19 @@ InputFilter[] inputFilters = inputBuffer.getFilters(); // Parse content-length header - int contentLength = request.getContentLength(); - if (contentLength >= 0) { - inputBuffer.addActiveFilter - (inputFilters[Constants.IDENTITY_FILTER]); - contentDelimitation = true; + int contentLength = 0; + + try { + contentLength = request.getContentLength(); + if (contentLength >= 0) { + inputBuffer.addActiveFilter + (inputFilters[Constants.IDENTITY_FILTER]); + contentDelimitation = true; + } + } catch (Throwable t) { + // 400 - Invalid Request + error = true; + response.setStatus(400); } // Parse transfer-encoding header ------_=_NextPart_000_01C3085E.E3F781A4 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org ------_=_NextPart_000_01C3085E.E3F781A4--