Arjohn,
Thanks for reporting this bug. I have just fixed it in SVN 1.1 branch and
SVN trunk. Also, I added a test case and I went for the less simple option
;-)
Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~
http://www.restlet.orgNoelios Technologies ~ Co-founder ~
http://www.noelios.com-----Message d'origine-----
De : Arjohn Kampman [mailto:
[hidden email]]
Envoyé : jeudi 5 novembre 2009 21:24
À :
[hidden email]
Objet : mark()/reset() bug in InputEntityStream
Hi again,
I'm running into a problem that I've traced back to InputEntityStream.
This class doesn't handle mark/reset combinations properly, although it
does indicate the this functionality is supported if the underlying
stream supports it. I'm setting a mark, read X bytes from the stream and
then reset the stream to the marked position. After this, the stream
ends exactly X bytes before the actual end of the stream.
The bug is related to the availableSize variable in InputEntityStream.
This variable is decreased with each call to read(...), but is never
increased when reset() is called.
There's a very simple and less simple solution for this. The very simple
solution is to override markSupported() and return false. The less
simple solution is to handle the mark/reset properly.
FWIW: I would prefer the less simple solution :-)
--
Arjohn Kampman, Senior Software Engineer
Aduna - Semantic Power
www.aduna-software.com
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2414898
------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=7458&dsMessageId=2416514