mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-08-07 14:25:17 +03:00
Fix quic-go write leak
This commit is contained in:
@@ -2,6 +2,7 @@ package v2rayquic
|
||||
|
||||
import (
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"github.com/sagernet/quic-go"
|
||||
qtls "github.com/sagernet/sing-quic"
|
||||
@@ -37,5 +38,8 @@ func (s *StreamWrapper) Upstream() any {
|
||||
func (s *StreamWrapper) Close() error {
|
||||
s.CancelRead(0)
|
||||
s.Stream.Close()
|
||||
// quic-go's Stream.Close does not unblock a Write blocked on flow control,
|
||||
// but a past write deadline does; buffered data and the FIN are unaffected.
|
||||
s.Stream.SetWriteDeadline(time.Now())
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user