On Thu, 2008-04-17 at 11:40 +0200, Jan Bracker wrote:
> Hello,
> 
> i'm using the DefaultHttpClient for downloading bigger files. When i
> want to abort a download i call response.getEntity().consumeContent()

Why? The purpose of HttpEntity#consumeContent() method is to ensure the
underlying connection is re-usable for subsequent requests, not to abort
the actual request 


> (I assume that is what i should do if i want to close connections of
> HttpClient). But the longer content downloaded on that connections get
> the more time it takes to close the given connection.
> 

Please use #abort method instead. 


> I allready looked at source and found the problem within
> ChunkedInputStream. consumeContent() calls close() to the InputStream
> and that close results in a call of exhaustInputStream() and that
> reads the complete rest of content sent by the host.
> 
> Why is this implemented like that? Why not just close the
> connection/stream?

To be able to use persistent connection reliably.


>  This behaviour is very annoying when wanting to
> stop a request that leads to a response entity of severel megabytes,
> especially on connections that are volume payed or have a slow
> bandwidth.
> 
> Is there a way to close the connection (consumeContent) of my current
> response without having to read the complete content? How do i solve
> my problem of closing connections quick and abrupt?
> 

See above.

Oleg

> Greetings, Jan Bracker
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to