Return-Path: Delivered-To: apmail-jakarta-httpcomponents-dev-archive@www.apache.org Received: (qmail 65913 invoked from network); 20 Feb 2007 17:44:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2007 17:44:27 -0000 Received: (qmail 6058 invoked by uid 500); 20 Feb 2007 17:44:35 -0000 Delivered-To: apmail-jakarta-httpcomponents-dev-archive@jakarta.apache.org Received: (qmail 6024 invoked by uid 500); 20 Feb 2007 17:44:35 -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 6011 invoked by uid 99); 20 Feb 2007 17:44:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 20 Feb 2007 09:44:35 -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; Tue, 20 Feb 2007 09:44:26 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id E92877141EE for ; Tue, 20 Feb 2007 09:44:05 -0800 (PST) Message-ID: <27532223.1171993445952.JavaMail.jira@brutus> Date: Tue, 20 Feb 2007 09:44:05 -0800 (PST) From: "Roland Weber (JIRA)" To: httpcomponents-dev@jakarta.apache.org Subject: [jira] Closed: (HTTPCLIENT-589) Do not consume the remaining response content if the connection is to be closed 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/HTTPCLIENT-589?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Roland Weber closed HTTPCLIENT-589. ----------------------------------- Resolution: Fixed This has been addressed as part of HTTPCLIENT-627. > Do not consume the remaining response content if the connection is to be closed > ------------------------------------------------------------------------------- > > Key: HTTPCLIENT-589 > URL: https://issues.apache.org/jira/browse/HTTPCLIENT-589 > Project: HttpComponents HttpClient > Issue Type: Improvement > Components: HttpClient > Affects Versions: 3.1 Alpha 1 > Environment: All environments > Reporter: James Murty > Assigned To: Oleg Kalnichevski > Fix For: 4.0 Alpha 1 > > Attachments: conn-release.patch, HttpMethodBase.java.diff > > > I am working on a HttpClient-based application to send and receive potentially large files (up to Gigabytes). When receiving large files the application allows the user to cancel the download, at which time it closes the response input stream behind the scenes. > The input stream currently provided by HttpMethodBase.getResponseBody() for un-chunked responses with a known content length is a ContentLengthInputStream, which automatically reads the remainder of the wrapped response instead of closing it straight away. This behaviour does not work well with very large files as the data is downloaded unnecessarily and the connection is held open for long very periods. > Per the HTTP 1.1 spec section 14.10 it seems to me that either a server or a client in an HTTP 1.1 connection can use the Connection:close directive to signal that a connection will be non-persistent, and will therefore not require that all data be read before the connection can be released (the cleaning up ContentLengthInputStream performs for persistent connections). > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 > Could HttpMethodBase be modified to check for this directive, from the server or client, and avoid wrapping the response input stream in ContentLengthInputStream when it is present? It seems straight-forward, though there may be side-effects I am not aware of. -- 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