Skip to content

Commit 8cf2d31

Browse files
committed
TUN-6938: Provide QUIC as first in protocol list
1 parent 0f95f8b commit 8cf2d31

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

connection/protocol.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ const (
2525
)
2626

2727
var (
28-
// ProtocolList represents a list of supported protocols for communication with the edge.
29-
ProtocolList = []Protocol{HTTP2, QUIC}
28+
// ProtocolList represents a list of supported protocols for communication with the edge
29+
// in order of precedence for remote percentage fetcher.
30+
ProtocolList = []Protocol{QUIC, HTTP2}
3031
)
3132

3233
type Protocol int64
@@ -171,7 +172,8 @@ func getProtocol(protocolPool []Protocol, fetchFunc edgediscovery.PercentageFetc
171172
}
172173
}
173174

174-
return protocolPool[len(protocolPool)-1], nil
175+
// Default to first index in protocolPool list
176+
return protocolPool[0], nil
175177
}
176178

177179
// defaultProtocolSelector will allow for a protocol to have a fallback
@@ -223,6 +225,7 @@ func NewProtocolSelector(
223225

224226
threshold := switchThreshold(accountTag)
225227
fetchedProtocol, err := getProtocol(ProtocolList, protocolFetcher, threshold)
228+
log.Debug().Msgf("Fetched protocol: %s", fetchedProtocol)
226229
if err != nil {
227230
log.Warn().Msg("Unable to lookup protocol percentage.")
228231
// Falling through here since 'auto' is handled in the switch and failing

0 commit comments

Comments
 (0)