Jetty
  1. Jetty
  2. JETTY-407

Response handled before finishing request parsing using AJP connector with chunked data

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.4
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      Ubuntu 7.04
      Apache/2.2.3 (mod_proxy_ajp)
    • Number of attachments :
      5

      Description

      I use apache and mod_proxy_ajp for communicating with jetty.

      When a client tries to send data to the server and the request is chunked,
      i can not retrieve request parameters, just null values but no errors.

      Indeed, after analysing the stream using wireshark i have the following request / response in this order :
      ----------------------------------------------------------------------------------
      POST /_log HTTP/1.1

      Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,/;q=0.5

      Content-Type: application/x-www-form-urlencoded

      Host: host
      Transfer-Encoding: chunked

      HTTP/1.1 200 OK

      Date: Tue, 31 Jul 2007 14:45:08 GMT

      Server: Server: Jetty(6.0.x)

      Content-Length: 0

      Content-Type: text/plain

      7e0

      data=...&data2=...

      19f

      ...

      0

      ----------------------------------------------------------------------------------

      I have not this problem using Apache with mod_proxy_http and the standard HTTP connector in jetty
      or using directly Jetty.

      After launching jetty in debug, i found in Ajp13Parser.java and especially the method blockForContent
      that the parsing is stopped if the Content-Length header is not present, therefore _contentLength variable
      will be HttpTokens.NO_CONTENT or HttpTokens.UNKNOWN_CONTENT.

      But, i have read that this Content-Length header is not mandatory for chunked request.

      I do not know if this part of the HTTP protocol is handled by mod_proxy_ajp or if it is up to jetty.

      1. ajp_patch_20070803.patch
        21 kB
        Leopoldo Agdeppa III
      2. ajp_patch_20070806.patch
        3 kB
        Greg Wilkins
      3. ajp_patch_20070806-2.patch
        3 kB
        Greg Wilkins
      4. ajp_patch_20070806-4.patch
        7 kB
        Leopoldo Agdeppa III
      5. JETTY-407-ajp-response-before-request-wireshark.dump
        6 kB
        Sebastien Launay

        Activity

        Hide
        Sebastien Launay added a comment -

        Great, the last patch (ajp_patch_20070806-4.patch) fixes my configuration.

        Now i can receive POST data, thanks .

        Show
        Sebastien Launay added a comment - Great, the last patch (ajp_patch_20070806-4.patch) fixes my configuration. Now i can receive POST data, thanks .
        Hide
        Leopoldo Agdeppa III added a comment -

        Sébastien Launay

        Is it ok if I may ask, What http client are you using for this? took me a lot of time just to reproduce this with the browser

        thanks
        bong

        Show
        Leopoldo Agdeppa III added a comment - Sébastien Launay Is it ok if I may ask, What http client are you using for this? took me a lot of time just to reproduce this with the browser thanks bong
        Hide
        Sebastien Launay added a comment -

        Requests came from a midlet application, especially from JVM from a mobile phone, you can reproduce it by using Sun Wireless Toolkit internal HTTP client.

        Show
        Sebastien Launay added a comment - Requests came from a midlet application, especially from JVM from a mobile phone, you can reproduce it by using Sun Wireless Toolkit internal HTTP client.
        Hide
        Leopoldo Agdeppa III added a comment -

        Sébastien Launay

        thanks, just curious

        Show
        Leopoldo Agdeppa III added a comment - Sébastien Launay thanks, just curious
        Hide
        Leopoldo Agdeppa III added a comment -

        got errors creating the patch, anyway here again

        Show
        Leopoldo Agdeppa III added a comment - got errors creating the patch, anyway here again

          People

          • Assignee:
            Leopoldo Agdeppa III
            Reporter:
            Sebastien Launay
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: