[ 
https://issues.apache.org/jira/browse/HTTPCORE-92?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12574247#action_12574247
 ] 

Oleg Kalnichevski commented on HTTPCORE-92:
-------------------------------------------

Pretty close, but there is a subtle bug in the code still 

+        if (avail < chunk) {
+            // write no more than 'avail' bytes
+            this.buffer.write((ByteBuffer)src.limit(avail));

Do not you think you some data in the source buffer gets lost unless the 
buffer's limit is reset to its original value? Try to extend the second test 
case to save all data from the source buffer to the content encode and see what 
happens.

Oleg 

> NIO ChunkEncoder does not flush the session output buffer
> ---------------------------------------------------------
>
>                 Key: HTTPCORE-92
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-92
>             Project: HttpComponents HttpCore
>          Issue Type: Improvement
>          Components: HttpCore NIO
>            Reporter: Oleg Kalnichevski
>             Fix For: 4.0-beta2
>
>         Attachments: fix2_92.patch, fix3_92.patch, possiblefix_92.patch, 
> write_reworked.txt
>
>
> Present implementation of the NIO ChunkEncoder is over-simplistic. It always 
> expands the session output buffer to store more content instead of trying to 
> free up space by flushing the buffered content.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to