I've got a question you may be able to help answer, Roy.

RFC2616 states that proxies must remove any transfer-coding (see end of message for quoted section). The way I read this is that updating Content-Length after dechunking an origin server response body is a hint that it'll be needed for sending the body back as response to a non-HTTP 1.1 client.

So, in this case, an HTTP 1.1 proxy will need to buffer the entire chunked origin server response body before sending it to a non-HTTP 1.1 client with a Content-Length header.

Is my interpretation correct? TIA.

PS: I understand the HTTP 1.1 client case is different, not only because of the introduction of TE headers.

Chuck

19.4.6 Introduction of Transfer-Encoding

   HTTP/1.1 introduces the Transfer-Encoding header field (section
   14.41). Proxies/gateways MUST remove any transfer-coding prior to
   forwarding a message via a MIME-compliant protocol.

   A process for decoding the "chunked" transfer-coding (section 3.6)
   can be represented in pseudo-code as:

       length := 0
       read chunk-size, chunk-extension (if any) and CRLF
       while (chunk-size > 0) {
          read chunk-data and CRLF
          append chunk-data to entity-body
          length := length + chunk-size
          read chunk-size and CRLF
       }
       read entity-header
       while (entity-header not empty) {
          append entity-header to existing header fields
          read entity-header
       }
       Content-Length := length
       Remove "chunked" from Transfer-Encoding

Chuck Murcko
Topsail Group
http://www.topsail.org/

Reply via email to