فهرست منبع

lib/connections: Add SyscallConn() to quic conn (fixes #7551) (#7570)

Simon Frei 4 سال پیش
والد
کامیت
15d2dc3a4f
1فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 7 1
      lib/connections/quic_listen.go

+ 7 - 1
lib/connections/quic_listen.go

@@ -16,6 +16,7 @@ import (
 	"strings"
 	"sync"
 	"sync/atomic"
+	"syscall"
 	"time"
 
 	"github.com/lucas-clemente/quic-go"
@@ -223,7 +224,12 @@ type stunConnQUICWrapper struct {
 	underlying *net.UDPConn
 }
 
-// SetReadBuffer is required by QUIC.
+// SetReadBuffer is required by QUIC < v0.20.0
 func (s *stunConnQUICWrapper) SetReadBuffer(size int) error {
 	return s.underlying.SetReadBuffer(size)
 }
+
+// SyscallConn is required by QUIC
+func (s *stunConnQUICWrapper) SyscallConn() (syscall.RawConn, error) {
+	return s.underlying.SyscallConn()
+}