mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-04 20:57:36 +03:00
use buffered qlog writers in example client and server, and interop
This commit is contained in:
parent
76bdd4a397
commit
86e9ab8f20
3 changed files with 24 additions and 3 deletions
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
"crypto/x509"
|
"crypto/x509"
|
||||||
|
@ -61,7 +62,13 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
log.Printf("Creating qlog file %s.\n", filename)
|
log.Printf("Creating qlog file %s.\n", filename)
|
||||||
return f
|
return struct {
|
||||||
|
io.Writer
|
||||||
|
io.Closer
|
||||||
|
}{
|
||||||
|
bufio.NewWriter(f),
|
||||||
|
f,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
roundTripper := &http3.RoundTripper{
|
roundTripper := &http3.RoundTripper{
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"crypto/md5"
|
"crypto/md5"
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
|
@ -215,7 +216,13 @@ func main() {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
log.Printf("Creating qlog file %s.\n", filename)
|
log.Printf("Creating qlog file %s.\n", filename)
|
||||||
return f
|
return struct {
|
||||||
|
io.Writer
|
||||||
|
io.Closer
|
||||||
|
}{
|
||||||
|
bufio.NewWriter(f),
|
||||||
|
f,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package utils
|
package utils
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
|
@ -38,6 +39,12 @@ func GetQLOGWriter() (func(connID []byte) io.WriteCloser, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to create qlog file %s: %s", path, err.Error())
|
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
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue