mirror of
https://github.com/octoleo/syncthing.git
synced 2024-11-09 14:50:56 +00:00
lib/connections: Revert add more methods to the quic conn wrapper (#7651)
This reverts commit faf15b4567
.
This commit is contained in:
parent
faf15b4567
commit
745cd4744a
@ -219,26 +219,17 @@ func (quicListenerFactory) Enabled(cfg config.Configuration) bool {
|
|||||||
return true
|
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 {
|
type stunConnQUICWrapper struct {
|
||||||
net.PacketConn
|
net.PacketConn
|
||||||
underlying *net.UDPConn
|
underlying *net.UDPConn
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetReadBuffer is required by QUIC < v0.20.0
|
||||||
func (s *stunConnQUICWrapper) SetReadBuffer(size int) error {
|
func (s *stunConnQUICWrapper) SetReadBuffer(size int) error {
|
||||||
return s.underlying.SetReadBuffer(size)
|
return s.underlying.SetReadBuffer(size)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SyscallConn is required by QUIC
|
||||||
func (s *stunConnQUICWrapper) SyscallConn() (syscall.RawConn, error) {
|
func (s *stunConnQUICWrapper) SyscallConn() (syscall.RawConn, error) {
|
||||||
return s.underlying.SyscallConn()
|
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)
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user