• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTP content-encoding / transfer-encoding

 
Craig Taylor
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've been looking over the RFC and am a bit confused over how responses that have both a content-encoding and a transfer-encoding are transmitted.

Is it :

Option A:


Or

Option B


(OB Disclaimer: Examples not meant to be accurate - adjust examples as appropriate for spacing / formatting etc .... )
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is not too clear.. but..

from the following..
3.6 Transfer Codings

Transfer-coding values are used to indicate an encoding transformation that has been, can be, or may need to be applied to an entity-body in order to ensure "safe transport" through the network. This differs from a content coding in that the transfer-coding is a property of the message, not of the original entity.


found at the w3c

It seems to suggest that in the case of chunked encoding for Transfer-Encoding is applied on top of the whole entity body encoded with a Content-Encoding. So the whole entity body has to be assembled first before decoding with the Content-Encoding.

This wikipedia article says the same thing...
 
Craig Taylor
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From that, I'm to conclude that the following rough format is valid:



Now, given that's the format of a chunk accept-encoding - how is the compression applied to it? Is compression only applied to the compressed data portions or to the whole message.

In other words, which of the following algorithms is correct:
getContent().getGUnzip().getChunks()

or
getContent().getChunks().combine().getGUnzip().uncombine()

where combine() and uncombine() record the length of the chunk portions and combine or uncombine them into one binary chunk.

Thanks,
 
Craig Taylor
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to followup - I saw your posting about this question at http://archives.free.net.ph/message/20090713.040925.99228eb7.en.html .... Thanks for following up and finding where to find the answer...

Thanks,

 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Craig,
Sorry for not updating earlier. I posted your (our ) doubt to the httpd users list.

You've already seen the answer. However, if I was working on an http implementation I would still be confused. I was going through the BNF and the "augmented BNF" that the http 1.1 spec is using. I'll be spending a bit more time trying figure out for sure how to derive the solution to this problem.
 
Alexandre de Paula
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same problem here. I think (but not sure yet) that I unchunked message body but I can't unzip it. I have already tried to unzip chunk by chunk and all assembled chunks, but I have failed both ways.
 
Alexandre de Paula
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I figured it out.
I assembled all chunks and then I could unzip the message. My mistake was ignoring the two last bytes after reading the zero-sized chunk!


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic