www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastian Turullols <sebast...@activephoto.com>
Subject mod_jserv/6822: JServInputStream.available() does not implement JavaSoft standard
Date Thu, 09 Nov 2000 01:46:19 GMT

>Number:         6822
>Category:       mod_jserv
>Synopsis:       JServInputStream.available() does not implement JavaSoft standard
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Nov 08 17:50:01 PST 2000
>Originator:     sebastian@activephoto.com
>Release:        1.3.12
Redhat Linux 6.2
According to Sun, this is what InputStream.available() should do:

Determines the number of bytes that can be read from this input stream without blocking. The
available method of InputStream returns 0. This method should be overridden by subclasses.

JServInputStream.available() does not obey this rule.  It returns the difference between the
CONTENT-LENGTH HTTP header and the amount of data that has already been read.  If the socket
connection is dropped .available() will say that data is available for a non-blocking read
when it is not.  This is VERY BAD because servlet threads will hang forever on reads.


This bug is EXTREMELY easy to fix.  It turns out that the SocketInputStream in that is a member
of JServInputStream correctly implements the available() method.  

All JServInputStream should do is:
   return in.available()
 [In order for any reply to be added to the PR database, you need]
 [to include <apbugs@Apache.Org> in the Cc line and make sure the]
 [subject line starts with the report component and number, with ]
 [or without any 'Re:' prefixes (such as "general/1098:" or      ]
 ["Re: general/1098:").  If the subject doesn't match this       ]
 [pattern, your message will be misfiled and ignored.  The       ]
 ["apbugs" address is not added to the Cc line of messages from  ]
 [the database automatically because of the potential for mail   ]
 [loops.  If you do not include this Cc, your reply may be ig-   ]
 [nored unless you are responding to an explicit request from a  ]
 [developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]

View raw message