mxmlnkn / rapidgzip

Gzip Decompression and Random Access for Modern Multi-Core Machines
Apache License 2.0
345 stars 7 forks source link

Possible wrong file descriptor value? #1

Closed Vadiml1024 closed 1 year ago

Vadiml1024 commented 1 year ago

https://github.com/mxmlnkn/pragzip/blob/653b9e6bbba86c0c3e2eb743265517a105843d83/src/pragzip/ParallelGzipReader.hpp#L240 Maybe i'm wrong on this but it seems that this default -1 value for file descriptor will be passed on write syscall

mxmlnkn commented 1 year ago

Negative file descriptors (a hack for an optional-like interface) are filtered in this writeAll overload.

That the file descriptor to the read call is used for a write is as it should be. This is the output file descriptor into which the decompressed result will be written.

Did you have any specific bug that got you looking into this particular code?

Vadiml1024 commented 1 year ago

Ah.. I' ve missed this overload... I don' t have any specific bug, i'm thinking about using pragzip in one of the projects i' m working on, so i' m browsing through the code.

mxmlnkn commented 1 year ago

Ah.. I' ve missed this overload... I don' t have any specific bug, i'm thinking about using pragzip in one of the projects i' m working on, so i' m browsing through the code.

Ok, note that the most important missing "feature" is any kind of memory limit control for very high compression ratios. See #2.