Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 36506 invoked by uid 500); 20 Sep 2001 10:08:50 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 36491 invoked from network); 20 Sep 2001 10:08:50 -0000 Date: 20 Sep 2001 10:08:56 -0000 Message-ID: <20010920100856.28319.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 3745] New: - Http10Interceptor hangs on PUT without Content-Length X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . 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=3745 Http10Interceptor hangs on PUT without Content-Length Summary: Http10Interceptor hangs on PUT without Content-Length Product: Tomcat 3 Version: 3.3 Beta 2 Platform: PC OS/Version: Windows NT/2K Status: NEW Severity: Major Priority: Other Component: Connectors AssignedTo: tomcat-dev@jakarta.apache.org ReportedBy: stefan.eissing@greenbytes.de When a PUT request has no Content-Length header, tomcat "hangs" on HttpServletRequest.getInputStream.read() as it will forever return 0 and never -1. The comment in ServletInputStreamFacade (see extract below) indicates that this can only happen in chunked encoding. This is a wrong assumpation as chunked encoding is only available in HTTP/1.1. In HTTP/1.0 the end of the message body can be indicated by closing the client side of the connection/socket. This is the behaviour working in Tomcat 3.2.x. Returning 0 results from the interplay between the following code extracts: In Lines 233-235 of Http10Interceptor.java public int doRead(byte[] b, int off, int len) throws IOException { if( available <= 0 ) return 0; In ServletInputStreamFacade.java, lines 107-119: if (limit == -1) { // Ask the adapter for more data. We are in the 'no content-length' // case - i.e. chunked encoding ( acording to http spec CL is required // for everything else. int rd=reqA.doRead(); if( rd<0 ) { limit=0; // no more bytes can be read. } else { bytesRead++; // for statistics } return rd; }