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 87A8CDF99 for ; Mon, 28 Jan 2013 11:47:22 +0000 (UTC) Received: (qmail 81323 invoked by uid 500); 28 Jan 2013 11:47:22 -0000 Delivered-To: apmail-hc-dev-archive@hc.apache.org Received: (qmail 81005 invoked by uid 500); 28 Jan 2013 11:47:15 -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 80590 invoked by uid 99); 28 Jan 2013 11:47:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 28 Jan 2013 11:47:13 +0000 Date: Mon, 28 Jan 2013 11:47:12 +0000 (UTC) From: "Ahsan (JIRA)" To: dev@hc.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HTTPASYNC-34) For some urls responding in a 302 the httpget request gets stuck MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HTTPASYNC-34?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13564221#comment-13564221 ] Ahsan commented on HTTPASYNC-34: -------------------------------- Oleg, Can you please provide an ETA of how soon this issue is expected to be resolved so I can plan according? Regards, Ahsan > For some urls responding in a 302 the httpget request gets stuck > ---------------------------------------------------------------- > > Key: HTTPASYNC-34 > URL: https://issues.apache.org/jira/browse/HTTPASYNC-34 > Project: HttpComponents HttpAsyncClient > Issue Type: Bug > Affects Versions: 4.0-beta3 > Environment: Debian 6, Java 1.6 > Reporter: Ahsan > Priority: Blocker > Fix For: 4.0-beta4 > > > For some urls responding in a 302 the httpget request gets stuck. e.g http://www.prweek.com/news/article/1167011/aeromobile-brief-moves-rooster-bell-pottinger/ > Here is the code: > import java.util.concurrent.CountDownLatch; > import org.apache.http.HttpResponse; > import org.apache.http.client.methods.HttpGet; > import org.apache.http.concurrent.FutureCallback; > import org.apache.http.impl.nio.client.DefaultHttpAsyncClient; > import org.apache.http.nio.client.HttpAsyncClient; > import org.apache.http.params.CoreConnectionPNames; > public class AsyncClientHttpExchangeFutureCallback { > public static void main(String[] args) throws Exception { > HttpAsyncClient httpclient = new DefaultHttpAsyncClient(); > httpclient.getParams() > .setIntParameter(CoreConnectionPNames.SO_TIMEOUT, 3000) > .setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 3000) > .setIntParameter(CoreConnectionPNames.SOCKET_BUFFER_SIZE, 8 * 1024) > .setBooleanParameter(CoreConnectionPNames.TCP_NODELAY, true); > httpclient.start(); > try { > HttpGet[] requests = new HttpGet[] { > new HttpGet("http://www.prweek.com/news/article/1167011/aeromobile-brief-moves-rooster-bell-pottinger/") > }; > final CountDownLatch latch = new CountDownLatch(requests.length); > for (final HttpGet request: requests) { > httpclient.execute(request, new FutureCallback() { > public void completed(final HttpResponse response) { > latch.countDown(); > System.out.println(request.getRequestLine() + "->" + response.getStatusLine()); > } > public void failed(final Exception ex) { > latch.countDown(); > System.out.println(request.getRequestLine() + "->" + ex); > } > public void cancelled() { > latch.countDown(); > System.out.println(request.getRequestLine() + " cancelled"); > } > }); > } > latch.await(); > System.out.println("Shutting down"); > } finally { > httpclient.shutdown(); > } > System.out.println("Done"); > } > } -- 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