hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <daniel.stu...@attensity.com>
Subject No IOException when reading from ResponseBodyStream
Date Mon, 13 Dec 2010 17:38:02 GMT

I'm using httpclient 3.1 and have the following problem:

After successfully sending a GET request I use getResponseBodyAsStream() to get access to
the InputStream with the returned data (The server uses chunked transfer).
While reading from the InputStream the server sending the result crashes. It's still possible
to read from the InputStream to some point (guess some data is buffered in the socket), but
of course not all of the expected data. Reading from the InputStream stops because -1 is returned
by read() which denotes EndOfStream. But this EndOfStream is not reached because all of the
data was transferred but because the connection is lost.  I would have expected that read()
throws an IOException as the chunked transfer ended in the middle of communication. Is there
any other way to find out that the EndOfStream was reached because of some internal problem
? Checking Content-Length is not an option because chunked transfer is used.


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

View raw message