make the logging.Tracer and logging.ConnectionTracer a struct (#4082)

This commit is contained in:
Marten Seemann 2023-09-16 18:58:51 +07:00 committed by GitHub
parent d8cc4cb3ef
commit 9b82196578
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 1388 additions and 1158 deletions

View file

@ -21,7 +21,7 @@ var _ = Describe("Packetization", func() {
It("bundles ACKs", func() {
const numMsg = 100
serverTracer := newPacketTracer()
serverCounter, serverTracer := newPacketTracer()
server, err := quic.ListenAddr(
"localhost:0",
getTLSConfig(),
@ -43,7 +43,7 @@ var _ = Describe("Packetization", func() {
Expect(err).ToNot(HaveOccurred())
defer proxy.Close()
clientTracer := newPacketTracer()
clientCounter, clientTracer := newPacketTracer()
conn, err := quic.DialAddr(
context.Background(),
fmt.Sprintf("localhost:%d", proxy.LocalPort()),
@ -104,8 +104,8 @@ var _ = Describe("Packetization", func() {
return
}
numBundledIncoming := countBundledPackets(clientTracer.getRcvdShortHeaderPackets())
numBundledOutgoing := countBundledPackets(serverTracer.getRcvdShortHeaderPackets())
numBundledIncoming := countBundledPackets(clientCounter.getRcvdShortHeaderPackets())
numBundledOutgoing := countBundledPackets(serverCounter.getRcvdShortHeaderPackets())
fmt.Fprintf(GinkgoWriter, "bundled incoming packets: %d / %d\n", numBundledIncoming, numMsg)
fmt.Fprintf(GinkgoWriter, "bundled outgoing packets: %d / %d\n", numBundledOutgoing, numMsg)
Expect(numBundledIncoming).To(And(