hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guru Prasad P.S" <prasad...@yahoo.com>
Subject Re: instream.read() ---- In SSL mode
Date Tue, 20 Apr 2010 11:17:04 GMT
Don't think there is any issue connection management logic. Only this use case has problem
and rest all works perfectly fine.

byte[] tmp = new byte[2048];
    while ((l = instream.read(tmp)) != -1) {

Execution of instream.read() prints following log. I'm sure application is not closing connection
before calling read().

DEBUG [org.apache.http.wire] << "END:VEVENT[\r][\n]"

DEBUG [org.apache.http.wire] << "END:VCALENDAR[\r][\n]"
DEBUG [org.apache.http.wire] << "[\r][\n]"
DEBUG [org.apache.http.impl.conn.DefaultClientConnection] Connection shut down
DEBUG [org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager] Released connection is
not reusable.

From: Oleg Kalnichevski <olegk@apache.org>
To: HttpClient User Discussion <httpclient-users@hc.apache.org>
Sent: Tue, April 20, 2010 4:18:40 PM
Subject: Re: instream.read() ---- In SSL mode

On Tue, 2010-04-20 at 03:34 -0700, Guru Prasad P.S wrote:
> Any reason why no exception is thrown in case of non ssl mode.

SSL transport is significantly more complex and different factors may
have an effect

> Explicitly the connection is not closed before reading data from stream.
> Making use of BufferedHttpEntity solves this issue. (Is it a right approach?)

If you are developing a proxy, no, it is not.

> entity = new BufferedHttpEntity(entity)
> entity.getContent();

BufferedHttpEntity does nothing special but read data from the input
stream into a memory buffer. Since the problem does not occur when
content is buffered, the issue is most likely caused by improper
connection management logic in your code.


To unsubscribe, e-mail: mailto:httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: mailto:httpclient-users-help@hc.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message