From 5cfbb976f47bedaa29ed2fc8194db4c825c7205f Mon Sep 17 00:00:00 2001 From: fatedier Date: Tue, 10 Jan 2023 10:19:37 +0800 Subject: [PATCH] pkg/util/net: fix quic streams leak (#3246) --- pkg/util/net/conn.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/util/net/conn.go b/pkg/util/net/conn.go index 1258ed4..a09da99 100644 --- a/pkg/util/net/conn.go +++ b/pkg/util/net/conn.go @@ -211,3 +211,8 @@ func (conn *wrapQuicStream) RemoteAddr() net.Addr { } return (*net.TCPAddr)(nil) } + +func (conn *wrapQuicStream) Close() error { + conn.Stream.CancelRead(0) + return conn.Stream.Close() +}