diff --git a/Release.md b/Release.md index bbcb8c5c..6738c32b 100644 --- a/Release.md +++ b/Release.md @@ -1,9 +1,4 @@ -### New +### Fix -* Add `oidc_scope` parameter to frpc when `authentication_method = oidc`. -* Support quic protocol between frpc and frps. - - -### Improve - -* Upgrade oidc and oauth2 package which is forward compatible. +* Server Plugin send incorrect op name for NewWorkConn. +* QUIC stream leak. diff --git a/cmd/frpc/sub/stcp.go b/cmd/frpc/sub/stcp.go index 989387bb..d84b23b7 100644 --- a/cmd/frpc/sub/stcp.go +++ b/cmd/frpc/sub/stcp.go @@ -59,7 +59,8 @@ var stcpCmd = &cobra.Command{ prefix = user + "." } - if role == "server" { + switch role { + case "server": cfg := &config.STCPProxyConf{} cfg.ProxyName = prefix + proxyName cfg.ProxyType = consts.STCPProxy @@ -75,7 +76,7 @@ var stcpCmd = &cobra.Command{ os.Exit(1) } proxyConfs[cfg.ProxyName] = cfg - } else if role == "visitor" { + case "visitor": cfg := &config.STCPVisitorConf{} cfg.ProxyName = prefix + proxyName cfg.ProxyType = consts.STCPProxy @@ -92,7 +93,7 @@ var stcpCmd = &cobra.Command{ os.Exit(1) } visitorConfs[cfg.ProxyName] = cfg - } else { + default: fmt.Println("invalid role") os.Exit(1) } diff --git a/cmd/frpc/sub/sudp.go b/cmd/frpc/sub/sudp.go index c781223d..f96a12e1 100644 --- a/cmd/frpc/sub/sudp.go +++ b/cmd/frpc/sub/sudp.go @@ -59,7 +59,8 @@ var sudpCmd = &cobra.Command{ prefix = user + "." } - if role == "server" { + switch role { + case "server": cfg := &config.SUDPProxyConf{} cfg.ProxyName = prefix + proxyName cfg.ProxyType = consts.SUDPProxy @@ -75,7 +76,7 @@ var sudpCmd = &cobra.Command{ os.Exit(1) } proxyConfs[cfg.ProxyName] = cfg - } else if role == "visitor" { + case "visitor": cfg := &config.SUDPVisitorConf{} cfg.ProxyName = prefix + proxyName cfg.ProxyType = consts.SUDPProxy @@ -92,7 +93,7 @@ var sudpCmd = &cobra.Command{ os.Exit(1) } visitorConfs[cfg.ProxyName] = cfg - } else { + default: fmt.Println("invalid role") os.Exit(1) } diff --git a/cmd/frpc/sub/xtcp.go b/cmd/frpc/sub/xtcp.go index 069cce7e..b8426989 100644 --- a/cmd/frpc/sub/xtcp.go +++ b/cmd/frpc/sub/xtcp.go @@ -59,7 +59,8 @@ var xtcpCmd = &cobra.Command{ prefix = user + "." } - if role == "server" { + switch role { + case "server": cfg := &config.XTCPProxyConf{} cfg.ProxyName = prefix + proxyName cfg.ProxyType = consts.XTCPProxy @@ -75,7 +76,7 @@ var xtcpCmd = &cobra.Command{ os.Exit(1) } proxyConfs[cfg.ProxyName] = cfg - } else if role == "visitor" { + case "visitor": cfg := &config.XTCPVisitorConf{} cfg.ProxyName = prefix + proxyName cfg.ProxyType = consts.XTCPProxy @@ -92,7 +93,7 @@ var xtcpCmd = &cobra.Command{ os.Exit(1) } visitorConfs[cfg.ProxyName] = cfg - } else { + default: fmt.Println("invalid role") os.Exit(1) } diff --git a/pkg/plugin/server/manager.go b/pkg/plugin/server/manager.go index 5a8a309c..516f407e 100644 --- a/pkg/plugin/server/manager.go +++ b/pkg/plugin/server/manager.go @@ -211,7 +211,7 @@ func (m *Manager) NewWorkConn(content *NewWorkConnContent) (*NewWorkConnContent, ctx = NewReqidContext(ctx, reqid) for _, p := range m.newWorkConnPlugins { - res, retContent, err = p.Handle(ctx, OpPing, *content) + res, retContent, err = p.Handle(ctx, OpNewWorkConn, *content) if err != nil { xl.Warn("send NewWorkConn request to plugin [%s] error: %v", p.Name(), err) return nil, errors.New("send NewWorkConn request to plugin error") diff --git a/pkg/util/net/conn.go b/pkg/util/net/conn.go index 1258ed48..a09da99e 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() +} diff --git a/pkg/util/version/version.go b/pkg/util/version/version.go index 6228c092..849002d7 100644 --- a/pkg/util/version/version.go +++ b/pkg/util/version/version.go @@ -19,7 +19,7 @@ import ( "strings" ) -var version = "0.46.0" +var version = "0.46.1" func Full() string { return version