mirror of
https://github.com/mjl-/mox.git
synced 2024-12-26 00:13:47 +03:00
fix flushing of transparently compressed gzip output
this is a problem for connections like SSE, that only send data on events. those events would stay in the gzip buffer until lots more data was written. bug because of automatically typing "if err != nil"... found while testing the maildir/mbox web-based import while working on message threading support. the import gets progress SSE events that were now hanging.
This commit is contained in:
parent
6f1e38f2ce
commit
b754b5f9ac
1 changed files with 1 additions and 1 deletions
|
@ -140,7 +140,7 @@ func (w *loggingWriter) Write(buf []byte) (int, error) {
|
|||
// issues due to buffering.
|
||||
// w.Gzip.Write updates w.Size with the compressed byte count.
|
||||
n, err = w.Gzip.Write(buf)
|
||||
if err != nil {
|
||||
if err == nil {
|
||||
err = w.Gzip.Flush()
|
||||
}
|
||||
if n > 0 {
|
||||
|
|
Loading…
Reference in a new issue