[ 
https://issues.apache.org/jira/browse/TRINIDAD-302?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12566526#action_12566526
 ] 

Matthias Weßendorf commented on TRINIDAD-302:
---------------------------------------------

here is the diff

http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/share/util/MultipartFormHandler.java?r1=429208&r2=430814&diff_format=h

> Bugs in the MultiPartFormHandler
> --------------------------------
>
>                 Key: TRINIDAD-302
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-302
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>            Reporter: Venkata Guddanti
>            Assignee: Adam Winer
>         Attachments: MultipartFormHandler.java, trunk.patch
>
>
> There are couple of bugs in the MultiPartFormHandler because of which it is 
> loosing a byte during the upload process. The two bugs are:
> 1. The MultiPartFormHandler$MultipartFormItem$MultipartInputStream wraps the 
> ServletInputStream and maintains its own buffer.  For every read request 
> fills up the buffer by doing multiple reads on the ServletInputStream  and 
> serves the data from its buffer during a read operation. There was some bug 
> in the complex  buffering logic where it was dropping a byte. The fix is to 
> not to fill up the buffer from the ServletInputStream and instead go to the 
> ServletInputStream.readLine whenever necessary for every read operation. 
> Similar fix needs to be applied in the 
> MultiPartFormHandler$MultipartFormItem.writeFile logic since it is doing the 
> same logic
> 2. There was a bug in the _readLine logic of MultiPartFormHandler. It was 
> dropping a byte under certain rare circumstances where the internal buffer 
> was getting full and when the last character read was a CR.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to