You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by otisg <ot...@ureach.com> on 2002/09/15 22:07:08 UTC

[httpclient] max response size

Hello,

I couldn't find this anywhere in the
Javadocs, and I saw that some work with
buffered/unbuffered responses was done
lately, and this may be related, so here's
my question:

Is it possible to specify the max number of
bytes to retrieve from a response?  Consider
the case where HttpClient can fall into a
'crawler trap', or simply encounter a
response with no end.  This would break an
application using HttpClient.
So I'm wondering if developers think that it
would be good to have the ability to
restrict the size of retrieved response to
some number of bytes, built into HttpClient?

Thanks,
Otis


________________________________________________
Get your own "800" number
Voicemail, fax, email, and a lot more
http://www.ureach.com/reg/tag

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [httpclient] max response size

Posted by Ortwin Glück <or...@nose.ch>.
Your app may want to get the data as an InputStream. Then you can decide 
yourself how many bytes you want to read. There might be some issues 
with closing the connection before the end of the stream has been reached.

However this is another candidate for a configuration property.

More about Http configuration will follow...

otisg wrote:
> Is it possible to specify the max number of
> bytes to retrieve from a response?  Consider
> the case where HttpClient can fall into a
> 'crawler trap', or simply encounter a
> response with no end.


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [httpclient] max response size

Posted by Ryan Hoegg <rh...@isisnetworks.net>.
otisg wrote:

>Is it possible to specify the max number of
>bytes to retrieve from a response?  Consider
>the case where HttpClient can fall into a
>'crawler trap', or simply encounter a
>response with no end.  This would break an
>application using HttpClient.
>So I'm wondering if developers think that it
>would be good to have the ability to
>restrict the size of retrieved response to
>some number of bytes, built into HttpClient?
>
I am not a committer, but I think this functionality is not in the 
package as yet.

I think this is a potentially useful idea, but another way to do it is 
with a response timeout instead of a maximum size.  Any committers want 
to jump in?

--
Ryan Hoegg
ISIS Networks


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>