[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haproxy
Subject:    Re: Chunked HTTP traffic
From:       Willy Tarreau <w () 1wt ! eu>
Date:       2009-07-27 21:16:27
Message-ID: 20090727211627.GA25188 () 1wt ! eu
[Download RAW message or body]

Hi Jeff,

On Mon, Jul 27, 2009 at 02:35:24PM -0400, Jeff Buchbinder wrote:
> I'm having a strange issue with haproxy, involving a client who is using 
> HTTP/1.1 "chunking" with requests, but is rudely not allowing fallback 
> to HTTP/1.0 behavior. (They're using Apache Coyote, if that makes any 
> difference).
> 
> Any attempt to grab data from them results in something like this from 
> java's HttpClient (since wget doesn't support chunking):
> 
> 2009/07/27 14:24:38:189 EDT [DEBUG] header - >> "User-Agent: Jakarta 
> Commons-HttpClient/3.1[\r][\n]"
> 2009/07/27 14:24:38:190 EDT [DEBUG] header - >> "Host: 
> (redacted):9080[\r][\n]"
> 2009/07/27 14:24:38:190 EDT [DEBUG] header - >> "[\r][\n]"
> 2009/07/27 14:24:38:275 EDT [DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
> 2009/07/27 14:24:38:276 EDT [DEBUG] header - << "HTTP/1.1 200 OK[\r][\n]"
> 2009/07/27 14:24:38:281 EDT [DEBUG] header - << "Server: 
> Apache-Coyote/1.1[\r][\n]"
> 2009/07/27 14:24:38:282 EDT [DEBUG] header - << "Content-Type: 
> text/xml[\r][\n]"
> 2009/07/27 14:24:38:283 EDT [DEBUG] header - << "Transfer-Encoding: 
> chunked[\r][\n]"
> 2009/07/27 14:24:38:284 EDT [DEBUG] header - << "Date: Mon, 27 Jul 2009 
> 18:24:38 GMT[\r][\n]"
> 2009/07/27 14:24:38:285 EDT [DEBUG] header - << "[\r][\n]"
> HTTP/1.1 200 OK
> 2009/07/27 14:24:38:297 EDT [DEBUG] content - << "2"
> 2009/07/27 14:24:38:298 EDT [DEBUG] content - << "0"
> 2009/07/27 14:24:38:299 EDT [DEBUG] content - << "0"
> 2009/07/27 14:24:38:299 EDT [DEBUG] content - << "0"
> 2009/07/27 14:24:38:300 EDT [DEBUG] content - << "[\r]"
> 2009/07/27 14:24:38:300 EDT [DEBUG] content - << "[\n]"
> 
> It obviously wants an additional request for the first 2000 bytes of 
> data, but the client just sits there, even though HttpClient supports 
> chunking.

No, look more closely. The server is telling the client it's sending
0x2000 bytes to it (8192 bytes). Maybe your debug above doesn't show
you the data ? Or maybe the server is not sending the data at all for
any mysterious reason ?

> Has anyone else seen behavior like this?
> 
> I have tried messing with the client and server timeout values, but it 
> always seems to produce the same result.

You should check with tcpdump or equivalent to ensure that the
server is sending the data or not. It says it will sendd, but here we
don't see those data. Anyway, that just looks like standard chunked
encoding, which is extremely common.

Regards,
Willy


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic