Repository: quic-go/quic-go
Pull request #4316 (2024-02-07 11:19:54)

README: Add frp to list of projects
https://github.com/fatedier/frp

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/quic-go/quic-go/pull/4316?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Comparison is base [(`c22a3c8`)](https://app.codecov.io/gh/quic-go/quic-go/commit/c22a3c8e6f7479d33d281d32a86b9b978c8e718e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go) 84.15% compared to head [(`ce54fe6`)](https://app.codecov.io/gh/quic-go/quic-go/pull/4316?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go) 84.17%.


<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff             @@
##           master    #4316      +/-   ##
==========================================
+ Coverage   84.15%   84.17%   +0.02%     
==========================================
  Files         150      147       -3     
  Lines       15368    15318      -50     
==========================================
- Hits        12932    12893      -39     
+ Misses       1938     1929       -9     
+ Partials      498      496       -2     
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/quic-go/quic-go/pull/4316?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=quic-go).

marten-seemann: That's a pretty outdated quic-go version, isn't it?
bt90: Crafting an issue for their repo is the next step :D

Patch:
diff --git a/README.md b/README.md
index 93f14dd9..faba82f3 100644
--- a/README.md
+++ b/README.md
@@ -226,6 +226,7 @@ http.Client{
 | [algernon](https://github.com/xyproto/algernon)           | Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support                                                            | ![GitHub Repo stars](https://img.shields.io/github/stars/xyproto/algernon?style=flat-square)        |
 | [caddy](https://github.com/caddyserver/caddy/)            | Fast, multi-platform web server with automatic HTTPS                                                                                                              | ![GitHub Repo stars](https://img.shields.io/github/stars/caddyserver/caddy?style=flat-square)       |
 | [cloudflared](https://github.com/cloudflare/cloudflared)  | A tunneling daemon that proxies traffic from the Cloudflare network to your origins                                                                               | ![GitHub Repo stars](https://img.shields.io/github/stars/cloudflare/cloudflared?style=flat-square)  |
+| [frp](https://github.com/fatedier/frp)                    | A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet                                                                   | ![GitHub Repo stars](https://img.shields.io/github/stars/fatedier/frp?style=flat-square)            |
 | [go-libp2p](https://github.com/libp2p/go-libp2p)          | libp2p implementation in Go, powering [Kubo](https://github.com/ipfs/kubo) (IPFS) and [Lotus](https://github.com/filecoin-project/lotus) (Filecoin), among others | ![GitHub Repo stars](https://img.shields.io/github/stars/libp2p/go-libp2p?style=flat-square)     |
 | [gost](https://github.com/go-gost/gost)                   | A simple security tunnel written in Go                                                                                                                        | ![GitHub Repo stars](https://img.shields.io/github/stars/go-gost/gost?style=flat-square)            |
 | [Hysteria](https://github.com/apernet/hysteria)           | A powerful, lightning fast and censorship resistant proxy                                                                                                         | ![GitHub Repo stars](https://img.shields.io/github/stars/apernet/hysteria?style=flat-square)        |
diff --git a/logging/connection_tracer.go b/logging/connection_tracer.go
index 0f2cbe04..7f54d6cd 100644
--- a/logging/connection_tracer.go
+++ b/logging/connection_tracer.go
@@ -27,9 +27,9 @@ type ConnectionTracer struct {
 	UpdatedCongestionState           func(CongestionState)
 	UpdatedPTOCount                  func(value uint32)
 	UpdatedKeyFromTLS                func(EncryptionLevel, Perspective)
-	UpdatedKey                       func(generation KeyPhase, remote bool)
+	UpdatedKey                       func(keyPhase KeyPhase, remote bool)
 	DroppedEncryptionLevel           func(EncryptionLevel)
-	DroppedKey                       func(generation KeyPhase)
+	DroppedKey                       func(keyPhase KeyPhase)
 	SetLossTimer                     func(TimerType, EncryptionLevel, time.Time)
 	LossTimerExpired                 func(TimerType, EncryptionLevel)
 	LossTimerCanceled                func()
diff --git a/qlog/connection_tracer.go b/qlog/connection_tracer.go
index ae328a38..c73a3fe3 100644
--- a/qlog/connection_tracer.go
+++ b/qlog/connection_tracer.go
@@ -85,14 +85,14 @@ func NewConnectionTracer(w io.WriteCloser, p logging.Perspective, odcid protocol
 		UpdatedKeyFromTLS: func(encLevel protocol.EncryptionLevel, pers protocol.Perspective) {
 			t.UpdatedKeyFromTLS(encLevel, pers)
 		},
-		UpdatedKey: func(generation protocol.KeyPhase, remote bool) {
-			t.UpdatedKey(generation, remote)
+		UpdatedKey: func(keyPhase protocol.KeyPhase, remote bool) {
+			t.UpdatedKey(keyPhase, remote)
 		},
 		DroppedEncryptionLevel: func(encLevel protocol.EncryptionLevel) {
 			t.DroppedEncryptionLevel(encLevel)
 		},
-		DroppedKey: func(generation protocol.KeyPhase) {
-			t.DroppedKey(generation)
+		DroppedKey: func(keyPhase protocol.KeyPhase) {
+			t.DroppedKey(keyPhase)
 		},
 		SetLossTimer: func(tt logging.TimerType, encLevel protocol.EncryptionLevel, timeout time.Time) {
 			t.SetLossTimer(tt, encLevel, timeout)
@@ -389,14 +389,14 @@ func (t *connectionTracer) UpdatedKey(generation protocol.KeyPhase, remote bool)
 	}
 	now := time.Now()
 	t.recordEvent(now, &eventKeyUpdated{
-		Trigger:    trigger,
-		KeyType:    keyTypeClient1RTT,
-		Generation: generation,
+		Trigger:  trigger,
+		KeyType:  keyTypeClient1RTT,
+		KeyPhase: generation,
 	})
 	t.recordEvent(now, &eventKeyUpdated{
-		Trigger:    trigger,
-		KeyType:    keyTypeServer1RTT,
-		Generation: generation,
+		Trigger:  trigger,
+		KeyType:  keyTypeServer1RTT,
+		KeyPhase: generation,
 	})
 }
 
@@ -413,12 +413,12 @@ func (t *connectionTracer) DroppedEncryptionLevel(encLevel protocol.EncryptionLe
 func (t *connectionTracer) DroppedKey(generation protocol.KeyPhase) {
 	now := time.Now()
 	t.recordEvent(now, &eventKeyDiscarded{
-		KeyType:    encLevelToKeyType(protocol.Encryption1RTT, protocol.PerspectiveServer),
-		Generation: generation,
+		KeyType:  encLevelToKeyType(protocol.Encryption1RTT, protocol.PerspectiveServer),
+		KeyPhase: generation,
 	})
 	t.recordEvent(now, &eventKeyDiscarded{
-		KeyType:    encLevelToKeyType(protocol.Encryption1RTT, protocol.PerspectiveClient),
-		Generation: generation,
+		KeyType:  encLevelToKeyType(protocol.Encryption1RTT, protocol.PerspectiveClient),
+		KeyPhase: generation,
 	})
 }
 
diff --git a/qlog/event.go b/qlog/event.go
index e2ceca9f..d3d26601 100644
--- a/qlog/event.go
+++ b/qlog/event.go
@@ -345,9 +345,9 @@ func (e eventPacketLost) MarshalJSONObject(enc *gojay.Encoder) {
 }
 
 type eventKeyUpdated struct {
-	Trigger    keyUpdateTrigger
-	KeyType    keyType
-	Generation protocol.KeyPhase
+	Trigger  keyUpdateTrigger
+	KeyType  keyType
+	KeyPhase protocol.KeyPhase
 	// we don't log the keys here, so we don't need `old` and `new`.
 }
 
@@ -359,13 +359,13 @@ func (e eventKeyUpdated) MarshalJSONObject(enc *gojay.Encoder) {
 	enc.StringKey("trigger", e.Trigger.String())
 	enc.StringKey("key_type", e.KeyType.String())
 	if e.KeyType == keyTypeClient1RTT || e.KeyType == keyTypeServer1RTT {
-		enc.Uint64Key("generation", uint64(e.Generation))
+		enc.Uint64Key("key_phase", uint64(e.KeyPhase))
 	}
 }
 
 type eventKeyDiscarded struct {
-	KeyType    keyType
-	Generation protocol.KeyPhase
+	KeyType  keyType
+	KeyPhase protocol.KeyPhase
 }
 
 func (e eventKeyDiscarded) Category() category { return categorySecurity }
@@ -378,7 +378,7 @@ func (e eventKeyDiscarded) MarshalJSONObject(enc *gojay.Encoder) {
 	}
 	enc.StringKey("key_type", e.KeyType.String())
 	if e.KeyType == keyTypeClient1RTT || e.KeyType == keyTypeServer1RTT {
-		enc.Uint64Key("generation", uint64(e.Generation))
+		enc.Uint64Key("key_phase", uint64(e.KeyPhase))
 	}
 }
 


Test patch:
diff --git a/qlog/connection_tracer_test.go b/qlog/connection_tracer_test.go
index 1e879ad9..dd4b800f 100644
--- a/qlog/connection_tracer_test.go
+++ b/qlog/connection_tracer_test.go
@@ -722,7 +722,7 @@ var _ = Describe("Tracing", func() {
 			ev := entry.Event
 			Expect(ev).To(HaveKeyWithValue("key_type", "client_handshake_secret"))
 			Expect(ev).To(HaveKeyWithValue("trigger", "tls"))
-			Expect(ev).ToNot(HaveKey("generation"))
+			Expect(ev).ToNot(HaveKey("key_phase"))
 			Expect(ev).ToNot(HaveKey("old"))
 			Expect(ev).ToNot(HaveKey("new"))
 		})
@@ -735,7 +735,7 @@ var _ = Describe("Tracing", func() {
 			ev := entry.Event
 			Expect(ev).To(HaveKeyWithValue("key_type", "server_1rtt_secret"))
 			Expect(ev).To(HaveKeyWithValue("trigger", "tls"))
-			Expect(ev).To(HaveKeyWithValue("generation", float64(0)))
+			Expect(ev).To(HaveKeyWithValue("key_phase", float64(0)))
 			Expect(ev).ToNot(HaveKey("old"))
 			Expect(ev).ToNot(HaveKey("new"))
 		})
@@ -749,7 +749,7 @@ var _ = Describe("Tracing", func() {
 				Expect(entry.Time).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
 				Expect(entry.Name).To(Equal("security:key_updated"))
 				ev := entry.Event
-				Expect(ev).To(HaveKeyWithValue("generation", float64(1337)))
+				Expect(ev).To(HaveKeyWithValue("key_phase", float64(1337)))
 				Expect(ev).To(HaveKeyWithValue("trigger", "remote_update"))
 				Expect(ev).To(HaveKey("key_type"))
 				keyTypes = append(keyTypes, ev["key_type"].(string))
@@ -796,7 +796,7 @@ var _ = Describe("Tracing", func() {
 				Expect(entry.Time).To(BeTemporally("~", time.Now(), scaleDuration(10*time.Millisecond)))
 				Expect(entry.Name).To(Equal("security:key_discarded"))
 				ev := entry.Event
-				Expect(ev).To(HaveKeyWithValue("generation", float64(42)))
+				Expect(ev).To(HaveKeyWithValue("key_phase", float64(42)))
 				Expect(ev).ToNot(HaveKey("trigger"))
 				Expect(ev).To(HaveKey("key_type"))
 				keyTypes = append(keyTypes, ev["key_type"].(string))