[ 
https://issues.apache.org/jira/browse/SLING-3255?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13830975#comment-13830975
 ] 

Jukka Zitting commented on SLING-3255:
--------------------------------------

See latest comments in OAK-956 for some additional background.

As for the Tomcat code, since it's in DefaultServlet, I believe it only needs 
to work with local files and resources inside jar/war files, in which cases the 
{{available()}} methods are implemented in a way to make 
{{BufferedInputStream}} work as expected by the code. It also seems that the 
code in Tomcat predates 
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6192696 where the behavior 
of {{BufferedInputStream}} was adjusted so that it no longer necessarily blocks 
to wait until the full requested number of bytes has been read.

> StreamRendererServlet makes incorrect assumptions about BufferedInputStream
> ---------------------------------------------------------------------------
>
>                 Key: SLING-3255
>                 URL: https://issues.apache.org/jira/browse/SLING-3255
>             Project: Sling
>          Issue Type: Bug
>          Components: Servlets
>    Affects Versions: Servlets Get 2.1.4
>            Reporter: Jukka Zitting
>            Assignee: Bertrand Delacretaz
>             Fix For: Servlets Get 2.1.6
>
>         Attachments: 
> 0001-SLING-3255-StreamRendererServlet-makes-incorrect-ass.patch
>
>
> The class (with code apparently borrowed from Tomcat) assumes that 
> BufferedInputStream.read(...) always fills the requested buffer, even if the 
> BIS does not make such a guarantee.
> See OAK-956 for related discussion.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to