Return-Path: Delivered-To: apmail-jakarta-taglibs-dev-archive@www.apache.org Received: (qmail 51921 invoked from network); 1 Aug 2004 14:56:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Aug 2004 14:56:22 -0000 Received: (qmail 82217 invoked by uid 500); 1 Aug 2004 14:56:20 -0000 Delivered-To: apmail-jakarta-taglibs-dev-archive@jakarta.apache.org Received: (qmail 82185 invoked by uid 500); 1 Aug 2004 14:56:20 -0000 Mailing-List: contact taglibs-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tag Libraries Developers List" Reply-To: "Tag Libraries Developers List" Delivered-To: mailing list taglibs-dev@jakarta.apache.org Received: (qmail 82172 invoked by uid 99); 1 Aug 2004 14:56:20 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.18.33.10] (HELO exchange.sun.com) (192.18.33.10) by apache.org (qpsmtpd/0.27.1) with SMTP; Sun, 01 Aug 2004 07:56:20 -0700 Received: (qmail 13397 invoked by uid 50); 1 Aug 2004 14:57:49 -0000 Date: 1 Aug 2004 14:57:49 -0000 Message-ID: <20040801145749.13396.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: taglibs-dev@jakarta.apache.org Cc: Subject: DO NOT REPLY [Bug 30427] New: - Response contents can be truncated prematurely X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.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://issues.apache.org/bugzilla/show_bug.cgi?id=30427 Response contents can be truncated prematurely Summary: Response contents can be truncated prematurely Product: Taglibs Version: 1.0 Platform: Other OS/Version: Other Status: NEW Severity: Normal Priority: Other Component: IO Taglib AssignedTo: taglibs-dev@jakarta.apache.org ReportedBy: david.goodenough@btconnect.com I think I have found a problem in the IO taglib.   I have a site where I use JSP with JSTL and the IO taglibs to provide a web frount end to a servlet which takes XML requests and delivers XML responses (this is used by some embedded systems as well as the web UI). Every now and then I get a null response back from the servlet when using the IO taglib.  The embedded systems never hit this problem. The log at the Servlet indicates that a response was sent, and ethereal concures. Originally the servlet only accepted https requests, even from the web UI, and this is where I hit this problem first.   I changed the servlet so that it would accept http requests from localhost and the problem diminished but did not go away. The problem - I think - is in the org.apache.taglibs.io.PipiHelper class, in the pipe routine.  It currently reads:-             while (true) {                 int size = input.read( buffer );                 if ( size <= 0 ) {                     return;                 }                 output.write( buffer, 0, size ); The problem is that size can be zero, especially for https sessions when the stream is not at end of file.  The only real end of file is when size == -1. The code should read:-             while (true) {                 int size = input.read( buffer );                 if ( size < 0 ) {                     return;                 }                 else if( size == 0)  {                         Thread.sleep( 1);                 }                 else {                          output.write( buffer, 0, size );                 } I am not sure whether the Thread sleep is necessary, but it does give the scheduler a chance when the request is to a local source in the same process (i.e. to a Tomcat servlet). --------------------------------------------------------------------- To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org