Re: Transfer-Encoding questions

rlgray@raleigh.ibm.com wrote:
  > When decoding chunked (section 3.6): 
  >  
  > 1) chunk-size is an arbitrary length hex string; however, it does not 
  >    say anything about byte order. 
  >    I presume, since the first digit cannot be zero except for the 
  >    ending chunk, that it is intended to be little endian? 

You're thinking too hard. :-)  It's just a number.  Convert it with
strtol().
  >  
  > 2) the spec is very vague on chunk-ext: it appears to be an extenstion 
  >    mechanism; what am I supposed to do if I don't understand it? 
  >    I presume ignore it. 

It is an extension mechanism.  Yes, ignore what you don't understand.

  >  
  > 3) what is the point of the CRLF after the chunk-data?  We already know 
  >    the size; it is only likely to introduce bugs in implementations 
  >    that decide (falsely) that it is safe to just scan for CRLF. 

It makes debugging easier, because each chunk-size begins on a new
line.  It would be reckless to scan for CRLF anyway, because CRLF could
be part of the chunked data.  So you obviously *have* to use the count.

Dave Kristol

Received on Friday, 11 October 1996 12:28:25 UTC