Menu

#6 HTTP 1.1 chunking problem

release_1.0
open
nobody
5
2012-10-12
2002-06-28
Julian Wood
No

We came across this bug when trying to traverse an
authenticating proxy-server. It turns out that for HTTP
1.1 requests, chunking is on by default (and we
couldn't figure out how to turn it off). Chunking
allows apache to start serving a request even though it
doesn't know the content length, and it chunks for all
dynamic data. It does this by adding a hex value at the
beginning of a chunk denoting the length of the chunk,
and then a 0 at the end of the chunk. Because XML-RPC
for PHP puts in a content-length header, apache gets a
bit confused when it also tries to chunk. What ends up
happening is the content-length produced by php is a
bit short, because those extra hex characters that
apache inserts for chunking aren't accounted for. Of
course, clients on the other end can't make heads or
tails of this response. The simple solution for us
(after many days of hair-pulling and going down wrong
roads) was to delete that content-length header, which
solves the problem for 1.1 requests, but will cause a
problem for 1.0 requests. There should probably be a
quick check for the HTTP version before the headers are
sent. This is at line 177 of xmlrpcs.inc (function
service()). We're using the 1.01 version.

Julian

Discussion

  • Gaetano Giunta

    Gaetano Giunta - 2002-08-10

    Logged In: YES
    user_id=114789

    Sorry, I've got no ideas at all about the pbl at hand, but I think
    Eric Kidd also found that out using his C library for XML-RPC
    (based on libwww for http). You might forward this to him/ask
    if he's got any advice...
    http://xmlrpc-c.sourceforge.net/

     
  • Gaetano Giunta

    Gaetano Giunta - 2004-02-01

    Logged In: YES
    user_id=114789

    Hey, now I know what you mean (bee studying... :).

    Gonna submit soon a patch that fixes chunked encoding (by
    decoding it), maybe you can test it.

    BTW, we're sending HTTP 1.0 requests, so we should get NO
    chunked encoding http 1.1. back!

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.