You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Michael Smith <ms...@xn.com.au> on 2001/06/01 05:17:50 UTC

chunked input bugfix

Yesterday I saw a bunch of 500 errors come up from a servlet we're
running. 
Fortunately, it turned out that there was a full stacktrace in the log
file.
I think the error itself was due to transient network faults (or client
bugs)at the client end of things, so it's not a problem that tomcat
rejects it - but it shouldn't be throwing a NullPointerException and
returning a 500 error.

This should fix it.

Michael


Index: HttpRequestStream.java
===================================================================
RCS file:
/home/cvspublic/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/connector/http/HttpRequestStream.java,v
retrieving revision 1.8
diff -u -r1.8 HttpRequestStream.java
--- HttpRequestStream.java	2001/02/20 21:38:44	1.8
+++ HttpRequestStream.java	2001/06/01 03:14:14
@@ -267,7 +267,9 @@
         chunkPos = 0;
         
         try {
-            String numberValue = readLineFromStream().trim();
+            String numberValue = readLineFromStream();
+	     if(numberValue != null)
+		 numerValue.trim();
             chunkLength = 
                 Integer.parseInt(numberValue, 16);
         } catch (NumberFormatException e) {