fix: Add CC for TUIC server

This commit is contained in:
Larvan2 2023-01-17 01:07:28 +08:00
parent f3b76df13b
commit db4f3eda55
2 changed files with 4 additions and 1 deletions

View File

@ -92,6 +92,7 @@ func ParseListener(mapping map[string]any) (C.InboundListener, error) {
AuthenticationTimeout: 1000,
ALPN: []string{"h3"},
MaxUdpRelayPacketSize: 1500,
CongestionController: "bbr",
}
err = decoder.Decode(mapping, tuicOption)
if err != nil {

View File

@ -73,6 +73,7 @@ func (s *Server) Close() error {
}
type serverHandler struct {
serverOption ServerOption
*Server
quicConn quic.Connection
uuid uuid.UUID
@ -166,7 +167,7 @@ func (s *serverHandler) handleStream() (err error) {
if err != nil {
return err
}
SetCongestionController(s.quicConn, s.CongestionController)
go func() (err error) {
stream := &quicStreamConn{
Stream: quicStream,
@ -214,6 +215,7 @@ func (s *serverHandler) handleUniStream() (err error) {
if err != nil {
return err
}
SetCongestionController(s.quicConn, s.CongestionController)
go func() (err error) {
defer func() {
stream.CancelRead(0)