Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Oct 27, 2024
1 parent 2fd978c commit 3ea53ef
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions fronted.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (f *fronted) vetBatch(start, batchSize int, successful *atomic.Uint32, list
log.Debugf("Vetting masquerade batch %d-%d", start, start+batchSize)
var wg sync.WaitGroup
masqueradeSize := len(f.masquerades)
for j := start; j < start+batchSize && j < masqueradeSize; j++ {
for i := start; i < start+batchSize && i < masqueradeSize; i++ {
wg.Add(1)
go func(m MasqueradeInterface) {
defer wg.Done()
Expand All @@ -166,7 +166,7 @@ func (f *fronted) vetBatch(start, batchSize int, successful *atomic.Uint32, list
go listener(f)
}
}
}(f.masquerades[j])
}(f.masquerades[i])
}
wg.Wait()
}
Expand Down
2 changes: 1 addition & 1 deletion fronted_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestDirectDomainFrontingWithSNIConfig(t *testing.T) {
ArbitrarySNIs: []string{"mercadopago.com", "amazon.com.br", "facebook.com", "google.com", "twitter.com", "youtube.com", "instagram.com", "linkedin.com", "whatsapp.com", "netflix.com", "microsoft.com", "yahoo.com", "bing.com", "wikipedia.org", "github.com"},
})
testContext := NewFrontingContext("TestDirectDomainFrontingWithSNIConfig")
testContext.Configure(certs, p, testProviderID, cacheFile)
testContext.Configure(certs, p, "akamai", cacheFile)

transport, ok := testContext.NewFronted(30 * time.Second)
require.True(t, ok)
Expand Down
2 changes: 1 addition & 1 deletion test_support.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ func testProvidersWithHosts(hosts map[string]string) map[string]*Provider {
}
func testAkamaiProvidersWithHosts(hosts map[string]string, sniConfig *SNIConfig) map[string]*Provider {
return map[string]*Provider{
testProviderID: NewProvider(hosts, pingTestURL, DefaultAkamaiMasquerades, nil, nil, sniConfig, nil),
"akamai": NewProvider(hosts, pingTestURL, DefaultAkamaiMasquerades, nil, nil, sniConfig, nil),
}
}

0 comments on commit 3ea53ef

Please sign in to comment.