make the buffered qlog writer used in interop flush before closing

This commit is contained in:
Marten Seemann
2020-03-19 12:58:56 +07:00
parent 2f2583beb0
commit 3e8c3cafc1
5 changed files with 57 additions and 21 deletions

View File

@@ -7,6 +7,8 @@ import (
"log"
"os"
"strings"
"github.com/lucas-clemente/quic-go/internal/utils"
)
// GetSSLKeyLog creates a file for the TLS key log
@@ -39,12 +41,6 @@ func GetQLOGWriter() (func(connID []byte) io.WriteCloser, error) {
if err != nil {
log.Fatalf("Failed to create qlog file %s: %s", path, err.Error())
}
return struct {
io.Writer
io.Closer
}{
bufio.NewWriter(f),
f,
}
return utils.NewBufferedWriteCloser(bufio.NewWriter(f), f)
}, nil
}