TUN-2854: Quick Reconnects should be an optional supported feature

This commit is contained in:
Adam Chalmers 2020-03-31 08:59:00 -05:00
parent c76283a2b4
commit acea15161c
2 changed files with 11 additions and 10 deletions

View File

@ -1,9 +0,0 @@
package connection
const (
FeatureSerializedHeaders = "serialized_headers"
)
var SupportedFeatures = []string{
FeatureSerializedHeaders,
}

View File

@ -39,6 +39,8 @@ const (
lbProbeUserAgentPrefix = "Mozilla/5.0 (compatible; Cloudflare-Traffic-Manager/1.0; +https://www.cloudflare.com/traffic-manager/;"
TagHeaderNamePrefix = "Cf-Warp-Tag-"
DuplicateConnectionError = "EDUPCONN"
FeatureSerializedHeaders = "serialized_headers"
FeatureQuickReconnects = "quick_reconnects"
)
type registerRPCName string
@ -165,10 +167,18 @@ func (c *TunnelConfig) RegistrationOptions(connectionID uint8, OriginLocalIP str
RunFromTerminal: c.RunFromTerminal,
CompressionQuality: c.CompressionQuality,
UUID: uuid.String(),
Features: connection.SupportedFeatures,
Features: c.SupportedFeatures(),
}
}
func (c *TunnelConfig) SupportedFeatures() []string {
basic := []string{FeatureSerializedHeaders}
if c.UseQuickReconnects {
basic = append(basic, FeatureQuickReconnects)
}
return basic
}
func StartTunnelDaemon(ctx context.Context, config *TunnelConfig, connectedSignal *signal.Signal, cloudflaredID uuid.UUID, reconnectCh chan struct{}) error {
s, err := NewSupervisor(config, cloudflaredID)
if err != nil {