mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
improve yamux logging (#4952)
This commit is contained in:
parent
80d3f332e1
commit
610e5ed479
6 changed files with 74 additions and 7 deletions
|
|
@ -17,7 +17,6 @@ package client
|
|||
import (
|
||||
"context"
|
||||
"crypto/tls"
|
||||
"io"
|
||||
"net"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
|
@ -115,7 +114,8 @@ func (c *defaultConnectorImpl) Open() error {
|
|||
|
||||
fmuxCfg := fmux.DefaultConfig()
|
||||
fmuxCfg.KeepAliveInterval = time.Duration(c.cfg.Transport.TCPMuxKeepaliveInterval) * time.Second
|
||||
fmuxCfg.LogOutput = io.Discard
|
||||
// Use trace level for yamux logs
|
||||
fmuxCfg.LogOutput = xlog.NewTraceWriter(xl)
|
||||
fmuxCfg.MaxStreamWindowSize = 6 * 1024 * 1024
|
||||
session, err := fmux.Client(conn, fmuxCfg)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -276,10 +276,12 @@ func (ctl *Control) heartbeatWorker() {
|
|||
}
|
||||
|
||||
func (ctl *Control) worker() {
|
||||
xl := ctl.xl
|
||||
go ctl.heartbeatWorker()
|
||||
go ctl.msgDispatcher.Run()
|
||||
|
||||
<-ctl.msgDispatcher.Done()
|
||||
xl.Debugf("control message dispatcher exited")
|
||||
ctl.closeSession()
|
||||
|
||||
ctl.pm.Close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue