use buffered qlog writers in example client and server, and interop

This commit is contained in:
Marten Seemann 2020-03-13 12:59:42 +07:00
parent 76bdd4a397
commit 86e9ab8f20
3 changed files with 24 additions and 3 deletions

View file

@ -1,6 +1,7 @@
package main
import (
"bufio"
"bytes"
"crypto/tls"
"crypto/x509"
@ -61,7 +62,13 @@ func main() {
log.Fatal(err)
}
log.Printf("Creating qlog file %s.\n", filename)
return f
return struct {
io.Writer
io.Closer
}{
bufio.NewWriter(f),
f,
}
}
}
roundTripper := &http3.RoundTripper{

View file

@ -1,6 +1,7 @@
package main
import (
"bufio"
"crypto/md5"
"errors"
"flag"
@ -215,7 +216,13 @@ func main() {
log.Fatal(err)
}
log.Printf("Creating qlog file %s.\n", filename)
return f
return struct {
io.Writer
io.Closer
}{
bufio.NewWriter(f),
f,
}
}
}

View file

@ -1,6 +1,7 @@
package utils
import (
"bufio"
"fmt"
"io"
"log"
@ -38,6 +39,12 @@ func GetQLOGWriter() (func(connID []byte) io.WriteCloser, error) {
if err != nil {
log.Fatalf("Failed to create qlog file %s: %s", path, err.Error())
}
return f
return struct {
io.Writer
io.Closer
}{
bufio.NewWriter(f),
f,
}
}, nil
}