Skip to content

Commit ad7a842

Browse files
authored
Merge pull request #412 from Jigsaw-Code/psiphon-fallback6
bug(x) don't attempt to fallback when there are no fallbacks
2 parents 23d6062 + e83c868 commit ad7a842

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

x/smart/stream_dialer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ func (f *StrategyFinder) findTLS(ctx context.Context, testDomains []string, base
340340
// Return the fastest fallback dialer that is able to access all the testDomans
341341
func (f *StrategyFinder) findFallback(ctx context.Context, testDomains []string, fallbackConfigs []fallbackEntryConfig) (transport.StreamDialer, error) {
342342
if len(fallbackConfigs) == 0 {
343-
return nil, errors.New("no fallback was specified")
343+
return nil, errors.New("attempted to find fallback but no fallback configuration was specified")
344344
}
345345

346346
ctx, searchDone := context.WithCancel(ctx)
@@ -473,7 +473,7 @@ func (f *StrategyFinder) NewDialer(ctx context.Context, testDomains []string, co
473473
}
474474

475475
dialer, err := f.newProxylessDialer(ctx, testDomains, parsedConfig)
476-
if err != nil {
476+
if err != nil && parsedConfig.Fallback != nil {
477477
return f.findFallback(ctx, testDomains, parsedConfig.Fallback)
478478
}
479479
return dialer, err

0 commit comments

Comments
 (0)