From 9bd4117058ffdf37e437de4bd9d56f3df208a2c4 Mon Sep 17 00:00:00 2001 From: Zach Reyes Date: Tue, 13 Sep 2022 00:59:32 -0400 Subject: [PATCH] Switched local var to deepcopy --- internal/transport/http2_client.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/transport/http2_client.go b/internal/transport/http2_client.go index e07c8f561d8c..bc5c8b41abe8 100644 --- a/internal/transport/http2_client.go +++ b/internal/transport/http2_client.go @@ -1233,7 +1233,11 @@ func (t *http2Client) handleGoAway(f *http2.GoAwayFrame) { upperLimit = math.MaxUint32 // Kill all streams after the GoAway ID. } - activeStreams := t.activeStreams + activeStreams := make(map[uint32]*Stream) + for streamID, stream := range t.activeStreams { + activeStreams[streamID] = stream + } + t.prevGoAwayID = id t.mu.Unlock() for streamID, stream := range activeStreams {