Skip to content

Can't tell whether there is more output when using max_length #248

@Dreamsorcerer

Description

@Dreamsorcerer

With the zlib module, it seems like unconsumed_tail is only empty if there's no more data to retrieve, meaning that to decompress our payload safely with max_length we can do something like this:

process_output(d.decompress(data, max_length))
while d.unconsumed_tail:
    process_output(d.decompress(d.unconsumed_tail, max_length))

When using isal.isal_zlib, it seems that there are situations where unconsumed_tail is empty and there's still more data available that will be returned if you call d.decompress(b""). It looks to me like there's no possible way for me to know if I've retrieved all the pending data except by making a redundant call and receiving b"".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions