From 745cd4744a46d3ac6d1e4dda3711a7ccbc4264da Mon Sep 17 00:00:00 2001 From: Audrius Butkevicius Date: Sun, 9 May 2021 18:43:16 +0100 Subject: [PATCH] lib/connections: Revert add more methods to the quic conn wrapper (#7651) This reverts commit faf15b4567a37ab543ae660f8729355c8e872e68. --- lib/connections/quic_listen.go | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/lib/connections/quic_listen.go b/lib/connections/quic_listen.go index 7c4e9fdc4..5c90cfff4 100644 --- a/lib/connections/quic_listen.go +++ b/lib/connections/quic_listen.go @@ -219,26 +219,17 @@ func (quicListenerFactory) Enabled(cfg config.Configuration) bool { return true } -// stunConnQUICWrapper provides methods used by quic. -// https://pkg.go.dev/github.com/lucas-clemente/quic-go#OOBCapablePacketConn -// https://github.com/lucas-clemente/quic-go/blob/master/packet_handler_map.go#L85 type stunConnQUICWrapper struct { net.PacketConn underlying *net.UDPConn } +// 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() } - -func (s *stunConnQUICWrapper) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error) { - return s.underlying.ReadMsgUDP(b, oob) -} - -func (s *stunConnQUICWrapper) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error) { - return s.underlying.WriteMsgUDP(b, oob, addr) -}