Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 12965 invoked from network); 4 Mar 2007 13:04:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Mar 2007 13:04:12 -0000 Received: (qmail 60718 invoked by uid 500); 4 Mar 2007 13:04:21 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 60518 invoked by uid 500); 4 Mar 2007 13:04:20 -0000 Mailing-List: contact httpcomponents-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "HttpComponents Project" Delivered-To: mailing list httpcomponents-dev@jakarta.apache.org Received: (qmail 60509 invoked by uid 99); 4 Mar 2007 13:04:20 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2007 05:04:20 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 04 Mar 2007 05:04:11 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id EA3C2714338 for ; Sun, 4 Mar 2007 05:03:50 -0800 (PST) Message-ID: <26102528.1173013430957.JavaMail.jira@brutus> Date: Sun, 4 Mar 2007 05:03:50 -0800 (PST) From: "Oleg Kalnichevski (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Updated: (HTTPCORE-51) My HttpRequestExecutionHandler.submitRequest is being called repeatedly In-Reply-To: <27860526.1172962190811.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HTTPCORE-51?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski updated HTTPCORE-51: -------------------------------------- Fix Version/s: (was: 4.0-alpha5) 4.0-alpha4 Assignee: Oleg Kalnichevski Affects Version/s: (was: 4.0-alpha5) > My HttpRequestExecutionHandler.submitRequest is being called repeatedly > ----------------------------------------------------------------------- > > Key: HTTPCORE-51 > URL: https://issues.apache.org/jira/browse/HTTPCORE-51 > Project: HttpComponents Core > Issue Type: Bug > Components: HttpCore NIO > Environment: Windows Vista > Reporter: Anders Wallgren > Assigned To: Oleg Kalnichevski > Fix For: 4.0-alpha4 > > > In my test suite, I'm sending a single post, but I'm finding that my HttpRequestExecutionHandler.submitRequest handler is being called multiple times. I think I've tracked it down to DefaultNHttpClientConnection.productOutput: > public void produceOutput(final NHttpClientHandler handler) { > try { > if (this.outbuf.hasData()) { > this.outbuf.flush(this.session.channel()); <<--- this is called > } > if (!this.outbuf.hasData()) { > if (this.closed) { > this.session.close(); > resetOutput(); > return; > } else { > if (this.contentEncoder != null) { > handler.outputReady(this, this.contentEncoder); > if (this.contentEncoder.isCompleted()) { > resetOutput(); <<<<----- then this > } > } > } > if (this.contentEncoder == null && !this.outbuf.hasData()) { > this.session.clearEvent(EventMask.WRITE); > } > } > } catch (IOException ex) { > handler.exception(this, ex); > } finally { > // Finally set buffered output flag > this.hasBufferedOutput = this.outbuf.hasData(); > } > if (this.request == null && !this.closed) { > handler.requestReady(this); <<<--- then this > } > } > The sequence of events is that my submitRequest is called once, then when the channel becomes writable, produceOutput is called. It's a small request (3 bytes of content), so the first branch is followed and outbuf is flushed. Then there is no more data, and the second branch is called, where resetOutput is called, but the method doesn't return. Then, at the bottom of produceOutput, handle.requestReady is called again, since resetOutput set request to null. > Am I doing something wrong, or is there a bug here? -- 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: httpcomponents-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org