hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c.@rrzn.uni-hannover.de
Subject Re: Proposal: Configurable HTTP Response length limit
Date Fri, 10 Oct 2003 14:12:05 GMT
Am Freitag, 10. Oktober 2003 13:33 schrieb Ortwin Gl├╝ck:
> Chris,
>
> Thanks for posting. However I really don't see why this should be a
> responsibility of HttpClient. The user can always discard the rest of a
> response if he wants to. I my eyes you are solving the problem at too
> low a level. The only problem that arises is with endless streams, since
> HttpClient always tries to consume the input stream until the end. The
> only thing you need is a way to forcibly end a connection.
>
> Odi

Odi,

thanks for your answer.

Indeed, endless streams (or streams returning more bytes than the JVM's free 
memory size) are the big problem of the current HttpClient.

HttpMethodBase's getResponseBody() has no hard limit and will cause the 
application to crash with an OutOfMemoryError when you are reading from a 
stream which is too long.

Then, you should probably mark getResponseBody and getResponseBodyAsString as 
deprecated because they will not terminate normally in this case.


Christian


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


Mime
View raw message