hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HTTPASYNC-40) Cannot suspend input when using AsyncByteConsumer
Date Thu, 25 Apr 2013 11:36:16 GMT

     [ https://issues.apache.org/jira/browse/HTTPASYNC-40?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Kalnichevski updated HTTPASYNC-40:
---------------------------------------

    Fix Version/s: 4.0-beta4
    
> Cannot suspend input when using AsyncByteConsumer
> -------------------------------------------------
>
>                 Key: HTTPASYNC-40
>                 URL: https://issues.apache.org/jira/browse/HTTPASYNC-40
>             Project: HttpComponents HttpAsyncClient
>          Issue Type: Bug
>    Affects Versions: 4.0-beta3
>            Reporter: Bodo Junglas
>            Priority: Minor
>             Fix For: 4.0-beta4
>
>
> When inheriting from org.apache.http.nio.client.methods.AsyncByteConsumer a suspendInput
on the iocrlt is unreliable. The core of the problem is this loop:
> for (;;) {
>             int bytesRead = decoder.read(this.bbuf);
>             if (bytesRead <= 0) {
>                 break;
>             }
>             this.bbuf.flip();
>             onByteReceived(this.bbuf, ioctrl);
>             this.bbuf.clear();
>         }
> I.e. while there is anything to be read it is delivered to onByteReceived non-stop (eat
or die).
> Unluckily a situation when a server delivers its data so fast that decoder.read never
returns 0 is usually also a situation when the client might want to suspend the input for
a moment.
> Workaround: Use AbstractAsyncResponseConsumer instead.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message