Re: [ProgressEvents] How to deal with compressed transfer encodings

* Anne van Kesteren wrote:
>On Tue, 23 Nov 2010 22:41:00 +0100, Jonas Sicking <jonas@sicking.cc> wrote:

>> A) Set "total" to 0, and "loaded" to the number of decompressed bytes
>> downloaded so far
>> B) Set "total" to the contents of the Content-Length header and
>> "loaded" the number of compressed bytes downloaded so far
>> C) Like A, but also expose a percentage downloaded which is based on
>> the compressed data

>When compression does not come into play they will only match for certain  
>encoding / byte streams anyway. E.g. for a UTF-8 encoded character stream  
>with characters that take up more than one byte they will not match. I  
>think it should be B.

That is what the draft already requires, if by "compressed" Jonas means
you remove all transfer encodings but retain the content encodings, and
you set .total to zero if the total length is not specified. (There are
even more layers of compression to consider if you don't speak plain
HTTP but, say, HTTP over TLS, since TLS has its own compression layer;
that would be removed aswell under the current draft.)
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Wednesday, 24 November 2010 02:32:29 UTC