W3C home > Mailing lists > Public > ietf-http-wg-old@w3.org > January to April 1997

Change to Chunk Length Syntax

From: Scott Lawrence <lawrence@agranat.com>
Date: Fri, 11 Apr 1997 09:18:50 -0400
Message-Id: <199704111319.JAA06457@devnix.agranat.com>
To: http-wg@cuckoo.hpl.hp.com
X-Mailing-List: <http-wg@cuckoo.hpl.hp.com> archive/latest/3008

  In Memphis, we discussed allowing leading zeros in the
  specification of a chunk length.

  For the benefit of those who were not there, and to more fully
  explain the reason for this change:

  Our server implementation is for embedded systems:

    - Usually the response to any request will consist partly
      of dynamically generated content whose length cannot be known
      before it is generated (hence the use of chunked encoding).

    - Embedded systems generally have less flexible buffering schemes
      (no scatter-gather buffers, for example).

  We must therefor leave room for the length in a buffer and then
  fill it when the dynamic content is complete; note that this space
  does not necessarily fall at the beginning of the buffer.

  Since we can't even know how many digits the length will require, it
  is convenient to be allowed to use leading zeros to consume any
  unused digits (a more complex workaround is available without this
  change, but it requires more bytes and is unsightly).

  I propose that the syntax description of chunked encoding be changed

       Chunked-Body   = *chunk

       chunk          = chunk-size [ chunk-ext ] CRLF
                        chunk-data CRLF

       chunk-size     = 1*HEX

       last-chunk     = 1*("0") [ chunk-ext ] CRLF

       chunk-ext      = *( ";" chunk-ext-name [ "=" chunk-ext-value ] )
       chunk-ext-name = token
       chunk-ext-val  = token | quoted-string
       chunk-data     = chunk-size(OCTET)

       footer         = *entity-header

  The chunked encoding is ended by any chunk whose size is zero,
  followed by the footer, which is terminated by an empty line.


  This modified syntax also allows a chunk-ext on the last chunk,
  which I added just for symmetry, and for the length of the final
  chunk to be multiple digits as long as they are all zero.

Scott Lawrence                                       <lawrence@agranat.com>
Agranat Systems, Inc.                               http://www.agranat.com/
Received on Friday, 11 April 1997 06:21:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:40:19 UTC