lib/connections: switch statement to get the QUIC network (#7816)
This commit is contained in:
@@ -11,6 +11,7 @@ package connections
|
||||
import (
|
||||
"crypto/tls"
|
||||
"net"
|
||||
"net/url"
|
||||
|
||||
"github.com/lucas-clemente/quic-go"
|
||||
"github.com/syncthing/syncthing/lib/util"
|
||||
@@ -23,6 +24,17 @@ var (
|
||||
}
|
||||
)
|
||||
|
||||
func quicNetwork(uri *url.URL) string {
|
||||
switch uri.Scheme {
|
||||
case "quic4":
|
||||
return "udp4"
|
||||
case "quic6":
|
||||
return "udp6"
|
||||
default:
|
||||
return "udp"
|
||||
}
|
||||
}
|
||||
|
||||
type quicTlsConn struct {
|
||||
quic.Session
|
||||
quic.Stream
|
||||
|
||||
Reference in New Issue
Block a user