hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kalnichevski, Oleg" <oleg.kalnichev...@bearingpoint.com>
Subject RE: Proposal: Configurable HTTP Response length limit
Date Fri, 10 Oct 2003 14:24:21 GMT
Chritian,
Allow me to express my opinion that overriding HttpMethodBase#getResponseBody & HttpMethodBase#getResponseBodyAsString
and providing a response length check inside those two methods seems (at least to me) a better
approach than poking around with low lever input stream objects. An implementation of a 'safer'
GetMethod or/and PostMethod will be happily accepted into out contrib package

In the future release (3.0) this problem might be solved using a generic response/request
filtering mechanism

Oleg

-----Original Message-----
From: ck@rrzn.uni-hannover.de [mailto:ck@rrzn.uni-hannover.de]
Sent: Friday, October 10, 2003 16:12
To: Commons HttpClient Project
Subject: Re: Proposal: Configurable HTTP Response length limit


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


---------------------------------------------------------------------
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