You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/11/21 17:31:35 UTC

DO NOT REPLY [Bug 24897] New: - Getting IOException when line length exceeds 4096

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24897>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24897

Getting IOException when line length exceeds 4096

           Summary: Getting IOException when line length exceeds 4096
           Product: Tomcat 5
           Version: 5.0.14
          Platform: Other
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Connector:Coyote
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: wenjun@creditex.com


Tomcat generates the following exception when processing a post with a line
longer than 4096 (including the "\n"):

java.io.IOException
        at org.apache.coyote.tomcat5.InputBuffer.reset(InputBuffer.java:463)
        at org.apache.coyote.tomcat5.CoyoteReader.reset(CoyoteReader.java:153)
        at org.apache.coyote.tomcat5.CoyoteReader.readLine
(CoyoteReader.java:207)
        at com.creditex.util.TestServlet.doPost(TestServlet.java:138)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)

The following is source for TestServlet:

  public void doPost(HttpServletRequest request, HttpServletResponse res) 
throws javax.servlet.ServletException  {
    BufferedReader reqReader = null;
    int status = res.SC_OK;
    try{
      reqReader = request.getReader();
      String s = null;
      while ((s=reqReader.readLine()) != null) {
        System.out.println("Read length " + s.length());
      }
    }
    catch(Exception e){
     e.printTrace();
    }
    finally {
      try {
        if (reqReader != null)
          reqReader.close();
        res.setStatus(status);
      } catch (IOException ie) {}
    }
  }

If length is exactly at 4096 (including "\n"), the servlet does not see
the data and no exception is thrown.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org