Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid quadratic complexity in GzDecoder (rust-lang#278)
* Avoid quadratic complexity in GzDecoder Quadratic complexity happens when the underlying reader supplies bytes one at a time and would block. And if header flag FNAME is set and we never have a null byte to end the filename, read_gz_header keeps reading all of the partial filename and computing the CRC... The solution is to keep a more complex structure than a simple buffer for what has already been parsed in the header (as is done in C zlib) * fixup rustfmt * fixup GzHeaderParsingState * fixup read_once * Revert "fixup read_once" This reverts commit e463973. * fixup using GzHeader in GzHeaderPartial * Fixup read_gz_header_part used by read_gz_header * fixup read_once and add test about it * fixup moce crc to GzHeaderPartial * dummy lifetime * It works
- Loading branch information