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 <[email protected]>
To: HttpClient User Discussion <[email protected]>
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.
Oleg
---------------------------------------------------------------------
To unsubscribe, e-mail: mailto:[email protected]
For additional commands, e-mail: mailto:[email protected]