www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Dusseault <m...@home.com>
Subject mod_jserv/5133: After a getInputStream, InputStream.available() always returns a 0
Date Fri, 08 Oct 1999 14:50:51 GMT

>Number:         5133
>Category:       mod_jserv
>Synopsis:       After a getInputStream, InputStream.available() always returns a 0
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Tue Oct 12 20:10:03 PDT 1999
>Originator:     mike@home.com
>Release:        Apache 1.3.9 + JServ 1.0 (though 1.1b1 has bug - I looked)
Linux + jdk1.1.7b (not that it matters, I located and fixed the bug... See later)
After getting the InputStream, any call to available always returns a 0.
Well, call available() on the InputStream (i.e. JServInputStream) and
you'll always always get a 0.
The default implementation of InputStream.available() merely returns a 0
at all times.  Someone just forgot to override the method.  Just add the
following to the JServInputStream inner class in JServConnection:

public int available()

Voila, and our servlet now runs properly.  Note that I had to cast to int
since that's what the InputStream method returns.  So you might as well
make that available variable an int rather than a long in this case.
Up to you guys.

Don't ya just love open source?  How long would it have taken me to
find this if I didn't have the source?  Yikes...  Once a programmer
goes open source, it's hard to go back.  The advantages are just too
huge.  CLosed source APIs are a stupid idea.

Keep up the good work folks!  Everybody appreciates it.
[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