Skip to content

Commit 0f1bfe9

Browse files
committed
TUN-8904: Rename Connect Response Flow Rate Limited metadata
## Summary This commit renames the public variable that identifies the metadata key and value for the ConnectResponse structure when the flow was rate limited. Closes TUN-8904
1 parent 18eecaf commit 0f1bfe9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

connection/quic_connection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ func (q *quicConnection) handleDataStream(ctx context.Context, stream *rpcquic.R
186186
var metadata []pogs.Metadata
187187
// Check the type of error that was throw and add metadata that will help identify it on OTD.
188188
if errors.Is(err, cfdflow.ErrTooManyActiveFlows) {
189-
metadata = append(metadata, pogs.ErrorFlowConnectRateLimitedKey)
189+
metadata = append(metadata, pogs.ErrorFlowConnectRateLimitedMetadata)
190190
}
191191

192192
if writeRespErr := stream.WriteConnectResponseData(err, metadata...); writeRespErr != nil {

connection/quic_connection_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ func TestTCPProxy_FlowRateLimited(t *testing.T) {
639639

640640
// Got Rate Limited
641641
assert.NotEmpty(t, response.Error)
642-
assert.Contains(t, response.Metadata, pogs.ErrorFlowConnectRateLimitedKey)
642+
assert.Contains(t, response.Metadata, pogs.ErrorFlowConnectRateLimitedMetadata)
643643
}()
644644

645645
tunnelConn, _ := testTunnelConnection(t, netip.MustParseAddrPort(udpListener.LocalAddr().String()), uint8(0))

tunnelrpc/pogs/quic_metadata_protocol.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ const (
1919
)
2020

2121
var (
22-
// ErrorFlowConnectRateLimitedKey is the Metadata entry that allows to know if a request was rate limited on connect.
23-
ErrorFlowConnectRateLimitedKey = Metadata{Key: "FlowConnectRateLimited", Val: "true"}
22+
// ErrorFlowConnectRateLimitedMetadata is the Metadata entry that allows to know if a request was rate limited on connect.
23+
ErrorFlowConnectRateLimitedMetadata = Metadata{Key: "FlowConnectRateLimited", Val: "true"}
2424
)
2525

2626
func (c ConnectionType) String() string {

0 commit comments

Comments
 (0)