Giter Site home page Giter Site logo

Comments (4)

ricea avatar ricea commented on August 16, 2024

Can you think of a good way to phrase it? How does this sound?

  • CompressionStream must not emit any data after the BFINAL block. DecompressionStream must consider any data after the BFINAL block to be an error.

Ideally we would have an option to control this, as concatenating multiple streams seems to be quite common in practice.

from compression.

fhanau avatar fhanau commented on August 16, 2024

Thank you for the quick response!
Based on how RFC 1951 defines BFINAL (BFINAL is set if and only if this is the last block of the data set.), it feels clear to me that a compliant CompressionStream should never produce data after a BFINAL block.
I would align the language with the other formats, perhaps It is an error for DecompressionStream if there is additional input data after the final block as indicated by the BFINAL flag.

Maybe I'm forgetting something, but I haven't encountered concatenated deflate streams much. One use case of not producing an error if there is trailing data would be to decompress a deflate stream within a file and then continue to process the following data, but that would require the position in the input data after the stream to be available, which is not part of the current API.
For now, I think it's best if the same behavior (i.e. not allowing trailing data) is applied to all formats.

from compression.

ricea avatar ricea commented on August 16, 2024

Thanks. I will make a PR unless you get there first.

If I understand correctly, it was popular to send multiple concatenated streams in HTTP responses when people didn't have a proper streaming compressor available. I don't know how much that is a problem nowadays. They wouldn't have been raw streams anyway.

from compression.

fhanau avatar fhanau commented on August 16, 2024

Thanks for explaining!
I have created a PR. On a related note, it looks like the explainer doesn't mention deflate-raw yet, so that should probably be changed too.

from compression.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.