support quic options (#3211)

This commit is contained in:
fatedier
2022-12-18 18:43:42 +08:00
committed by GitHub
parent b2e3946800
commit 7678938c08
12 changed files with 76 additions and 37 deletions

View File

@@ -147,7 +147,7 @@ func (ctl *Control) HandleReqWorkConn(inMsg *msg.ReqWorkConn) {
var startMsg msg.StartWorkConn
if err = msg.ReadMsgInto(workConn, &startMsg); err != nil {
xl.Error("work connection closed before response StartWorkConn message: %v", err)
xl.Trace("work connection closed before response StartWorkConn message: %v", err)
workConn.Close()
return
}

View File

@@ -374,7 +374,11 @@ func (cm *ConnectionManager) OpenConnection() error {
conn, err := quic.DialAddr(
net.JoinHostPort(cm.cfg.ServerAddr, strconv.Itoa(cm.cfg.ServerPort)),
tlsConfig, nil)
tlsConfig, &quic.Config{
MaxIdleTimeout: time.Duration(cm.cfg.QUICMaxIdleTimeout) * time.Second,
MaxIncomingStreams: int64(cm.cfg.QUICMaxIncomingStreams),
KeepAlivePeriod: time.Duration(cm.cfg.QUICKeepalivePeriod) * time.Second,
})
if err != nil {
return err
}