hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Thompson" <tony.thomp...@stone-ware.com>
Subject Re: HTTP client hang
Date Thu, 04 Mar 2004 02:30:26 GMT
Mike,

It may be tough to get a wire log because I am seeing this at a
customer site and they may be sensitive about their data.  I will check
into it though.

Here is roughly what I do:

1. I create a POST method and set the following
method.setPath();
method.setQueryString();
method.setRequestBody( <input stream> );
method.setFollowRedirects( false );

2. Execute the method
status = m_httpClient.executeMethod( method );

3. Copy the response to an OutputStream
InputStream content = method.getResponseBodyAsStream();
if( content != null ) {
    copy( content, outputStream, -1 );
}

I guess I may have been a bit harsh when I said the client hangs.  From
my perspective, it hangs because I don't ever get all of the data back
that I should.  It seems like the HTTP client has set the socket receive
buffer really small and it can't receive the entire response.  After
looking at the packet trace, the client receives exactly 24KB (24576
bytes) of the response and then shuts down the socket (the full response
is around 27KB).

I am sure that my code is functional.  I have already submitted several
other requests to this host before this one fails.

Hopefully that helps a bit.
Tony

>>> becke@u.washington.edu 03/03/04 08:22PM >>>
Hi Tony,

Can you give an example of the code you are using, and where exactly 
things are hanging?  Also, a wire log may also be helpful 
<http://jakarta.apache.org/commons/httpclient/logging.html>.

Mike

On Mar 3, 2004, at 2:32 PM, Tony Thompson wrote:

> I am having an issue with the HTTP client hanging when it is trying
to
> receive a large amount of data from a web server.  After doing a
packet
> trace, I noticed that as the HTTP client is receiving a large amount
of
> data, the TCP window size goes to zero and communication just stops. 

> Is
> there something I need to configure differently to get around this
> situation?
>
> I am using JDK 1.4.2 but, I have tried different JVMs and it doesn't
> make any difference.  The response that the client is receiving is
in
> response to a POST and it is coming back in several continuation 
> packets
> (don't know if that matters).
>
> Thanks.
> Tony
>
>
---------------------------------------------------------------------
> 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 


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