Return-Path: X-Original-To: apmail-hc-dev-archive@www.apache.org Delivered-To: apmail-hc-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5CF66107F0 for ; Thu, 25 Apr 2013 07:44:24 +0000 (UTC) Received: (qmail 81145 invoked by uid 500); 25 Apr 2013 07:44:24 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 80032 invoked by uid 500); 25 Apr 2013 07:44:19 -0000 Mailing-List: contact dev-help@hc.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list dev@hc.apache.org Received: (qmail 79299 invoked by uid 99); 25 Apr 2013 07:44:16 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Apr 2013 07:44:16 +0000 Date: Thu, 25 Apr 2013 07:44:15 +0000 (UTC) From: "Bodo Junglas (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (HTTPASYNC-40) Cannot suspend input when using AsyncByteConsumer MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Bodo Junglas created HTTPASYNC-40: ------------------------------------- Summary: 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 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