mirror of
https://github.com/mjl-/mox.git
synced 2025-07-12 16:24:37 +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:
@ -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 {
|
||||
|
Reference in New Issue
Block a user