golang/go

compress/flate: implement partial flush

Open

#31,514 opened on Apr 17, 2019

View on GitHub
 (20 comments) (0 reactions) (0 assignees)Go (19,008 forks)batch import
FeatureRequestNeedsFixhelp wanted

Repository metrics

Stars
 (133,883 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

What version of Go are you using (go version)?

go-1.11.5

while trying to implement zlib compression for SSH (by internal Google request, https://github.com/golang/go/issues/31369), I stumbled on lack of support for partial flush.

partial flush is described more precisely here: https://www.bolet.org/~pornin/deflate-flush.html (look for Z_PARTIAL_FLUSH). While this is deprecated functionality, it has also made its way into the SSH RFC.

For the write side, it looks like I can't truncate the sync marker from a full flush to get the same effect.

For the read side, feeding packets from OpenSSH into zlib.Reader leads to errors ("unexpected EOF").

Contributor guide