From df42df9d20a2a292ad3e36d1beca2890dd393a7f Mon Sep 17 00:00:00 2001 From: xtaci Date: Tue, 19 Nov 2024 13:56:48 +0800 Subject: [PATCH] update smux to fix the bug of session close --- go.mod | 2 +- go.sum | 2 ++ vendor/github.com/xtaci/smux/session.go | 9 ++++++--- vendor/modules.txt | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index d38f91821..c5bb6fb0d 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( github.com/urfave/cli v1.22.16 github.com/xtaci/kcp-go/v5 v5.6.18 github.com/xtaci/qpp v1.1.17 - github.com/xtaci/smux v1.5.31 + github.com/xtaci/smux v1.5.32 github.com/xtaci/tcpraw v1.2.31 golang.org/x/crypto v0.28.0 ) diff --git a/go.sum b/go.sum index dab7865ea..10b37eb1a 100644 --- a/go.sum +++ b/go.sum @@ -76,6 +76,8 @@ github.com/xtaci/qpp v1.1.17 h1:w35NYqF3wOBoAMs+2qA2XFjkNQ12mugw51CUJ7OcTzo= github.com/xtaci/qpp v1.1.17/go.mod h1:dJS3usaXNMbWxZSWCAdxz01UgJcz9wXDkd4BccDY/V0= github.com/xtaci/smux v1.5.31 h1:3ha7sHtH46h85Iv7MfQogxasuRt1KPRhoFB3S4rmHgU= github.com/xtaci/smux v1.5.31/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= +github.com/xtaci/smux v1.5.32 h1:IDdOaJDf8jk5NHKlTw05ge+0rdMjnXg3cwHkss5Pbcw= +github.com/xtaci/smux v1.5.32/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY= github.com/xtaci/tcpraw v1.2.31 h1:i9mXzejnGJdGi0DpVKUn19Hq202/sHOJt0kObEwuE/U= github.com/xtaci/tcpraw v1.2.31/go.mod h1:T1blYD2EDkLneb+HtxddnzX38SoC9BG537EhkXeaT2k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= diff --git a/vendor/github.com/xtaci/smux/session.go b/vendor/github.com/xtaci/smux/session.go index d5b4c5ad6..19806be0b 100644 --- a/vendor/github.com/xtaci/smux/session.go +++ b/vendor/github.com/xtaci/smux/session.go @@ -195,9 +195,12 @@ func (s *Session) OpenStream() (*Stream, error) { default: s.streams[sid] = stream wrapper := &Stream{stream: stream} - runtime.SetFinalizer(wrapper, func(s *Stream) { - s.Close() - }) + // NOTE(x): disabled finalizer for issue #997 + /* + runtime.SetFinalizer(wrapper, func(s *Stream) { + s.Close() + }) + */ return wrapper, nil } } diff --git a/vendor/modules.txt b/vendor/modules.txt index 84dc292b1..5bd836fee 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -50,7 +50,7 @@ github.com/xtaci/kcp-go/v5 # github.com/xtaci/qpp v1.1.17 ## explicit; go 1.22.3 github.com/xtaci/qpp -# github.com/xtaci/smux v1.5.31 +# github.com/xtaci/smux v1.5.32 ## explicit; go 1.13 github.com/xtaci/smux # github.com/xtaci/tcpraw v1.2.31