hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ossf...@dubioso.net>
Subject Re: Premature EOF on socket read
Date Fri, 31 Aug 2007 17:58:08 GMT
Hello Henrich,

> Subsequently no IOException is thrown. My reading of
> http://www.mail-archive.com/httpclient-user@jakarta.apache.org/msg03923.html
>  was that one can assume that the entire resource was downloaded when EOF
> is encountered. Now I wonder how/where this situation should be handled?

Theoretically? Yes. If all components adhere to HTTP.
In your case, either the server or proxy don't.

> One thought is that ContentLengthInputStream is in a position to know and
> could throw some kind of premature EOF encountered exception.

That's how it is implemented in HttpCore-4.0. Unfortunately,
HttpClient 3.1 does not check the actual length received.
You can do that in your application however.

> Presumably the default retry logic would then retry such a request.

It wouldn't. By the time you start reading the response entity,
HttpClient.executeMethod has already returned and can therefore
not repeat the request.
> 
> Or should this be handled by the application?

Exactly.

hope that helps,
  Roland


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


Mime
View raw message