Chunked responses

Discussion in 'Java' started by Veerle, May 18, 2009.

  1. Veerle

    Veerle Guest

    Hi,

    We are using Axis 1.0 on a JRun web server on linux for a new created
    webservice. When the webservice sends a gzipped response, it is
    automatically chunked as well. I understand that is the consequence of
    http/1.1 where chunks are the default. We need the http/1.1 but our
    client app cannot handle the chunks, so we need a regular unchunked
    reponse. Any thoughts on how to accomplish this? Is it something we
    can configure in server-config.wsdd, or somewhere else?

    Strange thing is, if we install a JRun web server on our pc (Win XP)
    and try the same thing then we don't have chunks at all...

    Veerle
    Veerle, May 18, 2009
    #1
    1. Advertising

  2. Veerle

    Roedy Green Guest

    On Mon, 18 May 2009 08:11:50 -0700 (PDT), Veerle
    <> wrote, quoted or indirectly quoted someone
    who said :

    >Strange thing is, if we install a JRun web server on our pc (Win XP)
    >and try the same thing then we don't have chunks at all...


    If you can get down low enough, chunking is controlled with:

    HttpURLConnection.setChunkedStreamingMode( 4096 );

    The default is 4096 chunksize.

    --
    Roedy Green Canadian Mind Products
    http://mindprod.com

    "It wasn’t the Exxon Valdez captain’s driving that caused the Alaskan oil spill. It was yours."
    ~ Greenpeace advertisement New York Times 1990-02-25
    Roedy Green, May 19, 2009
    #2
    1. Advertising

  3. Veerle

    Veerle Guest

    On 18 mei, 17:50, Steven Simpson <> wrote:
    > ...so you can't really have a genuine HTTP/1.1 client that doesn't
    > understand 'chunked'.


    The client app has a bug that prevents chunked responses from being
    unzipped correctly.

    > What control do you have over the client app?  Can you force it to use
    > HTTP/1.0?  What other aspect of HTTP/1.1 do you need?


    We use some aspects of HTTP/1.1 so we cannot downgrade the client
    application to HTTP/1.0

    The only 2 differences between running the web server locally and
    running it on the linux server are:
    - locally = Win XP ; server = Linux (same version of JRun)
    - Linux server has an Apache installed as well
    My guess is that the Apache is responsible for doing the chunking, but
    I cannot find why and how to prevent it
    Veerle, May 19, 2009
    #3
  4. Veerle

    Lew Guest

    Veerle wrote:
    > On 18 mei, 17:50, Steven Simpson <> wrote:
    >> ...so you can't really have a genuine HTTP/1.1 client that doesn't
    >> understand 'chunked'.

    >
    > The client app has a bug that prevents chunked responses from being
    > unzipped correctly.
    >
    >> What control do you have over the client app? Can you force it to use
    >> HTTP/1.0? What other aspect of HTTP/1.1 do you need?

    >
    > We use some aspects of HTTP/1.1


    Yeah, like chunked responses.

    > so we cannot downgrade the client application to HTTP/1.0
    >
    > The only 2 differences between running the web server locally and
    > running it on the linux server are:
    > - locally = Win XP ; server = Linux (same version of JRun)
    > - Linux server has an Apache installed as well
    > My guess is that the Apache is responsible for doing the chunking, but
    > I cannot find why and how to prevent it


    I'm certain that it is not wise to program to accommodate a bug. Someone will
    eventually fix the bug. The only correct approach to bugs is to fix them.

    --
    Lew
    Lew, May 19, 2009
    #4
  5. Veerle

    Tom Anderson Guest

    On Tue, 19 May 2009, Veerle wrote:

    > On 18 mei, 17:50, Steven Simpson <> wrote:
    >> ...so you can't really have a genuine HTTP/1.1 client that doesn't
    >> understand 'chunked'.

    >
    > The client app has a bug that prevents chunked responses from being
    > unzipped correctly.


    Okay, so it's broken. It would be better to put resources into fixing it.
    This may not be practical for political reasons, of course.

    >> What control do you have over the client app?  Can you force it to use
    >> HTTP/1.0?  What other aspect of HTTP/1.1 do you need?

    >
    > We use some aspects of HTTP/1.1 so we cannot downgrade the client
    > application to HTTP/1.0
    >
    > The only 2 differences between running the web server locally and
    > running it on the linux server are:
    > - locally = Win XP ; server = Linux (same version of JRun)
    > - Linux server has an Apache installed as well
    > My guess is that the Apache is responsible for doing the chunking, but
    > I cannot find why and how to prevent it


    So hang on, are you using JRun behind Apache, via ajp12 or whatever, or
    using its own web server, like Tomcat or something?

    If the former, then yes, you need to look into the Apache docs to find out
    how to switch off chunking.

    If the latter, the only thing that springs to mind is that the default
    socket send buffer sizes might be different. If they are, it's possible
    that the HTTP server's own servlet output buffers are different sizes
    (being sized to fit the TCP buffers). My understanding is that web servers
    switch from solid to chunked encoding when (a) they haven't been given a
    content-length upfront and (b) they've been given more than a buffer-full
    of data. So, different socket buffer sizes might (*might* - this is
    speculation!) lead to the onset of chunking at a different output size.
    How big is your output, and do you consistently see chunking on linux, or
    is it intermittent?

    tom

    --
    Our only chance for survival is better engineering. -- James Dyson
    Tom Anderson, May 19, 2009
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. CW

    transfer encoding: chunked

    CW, Feb 15, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    539
  2. Replies:
    0
    Views:
    1,011
  3. Replies:
    10
    Views:
    7,705
  4. Replies:
    0
    Views:
    353
  5. Philip Semanchuk
    Replies:
    0
    Views:
    419
    Philip Semanchuk
    Mar 9, 2006
Loading...

Share This Page