Skip to content

Commit

Permalink
Merge pull request getlantern#2979 from getlantern/issue2976
Browse files Browse the repository at this point in the history
Use separate copies of http.Client closes #2976
  • Loading branch information
uaalto committed Aug 18, 2015
2 parents a7e7054 + 55ab799 commit e988fa7
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/github.com/getlantern/flashlight/flashlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ func applyClientConfig(client *client.Client, cfg *config.Config) {
if hqfd == nil {
log.Errorf("No fronted dialer available, not enabling geolocation, config lookup, or stats")
} else {
// An *http.Client that uses the highest QOS dialer.
hqfdClient := hqfd.NewDirectDomainFronter()
config.Configure(hqfdClient)
geolookup.Configure(hqfdClient)
statserver.Configure(hqfdClient)
// Give everyone their own *http.Client that uses the highest QOS dialer. Separate
// clients for everyone avoids data races configuring those clients.
config.Configure(hqfd.NewDirectDomainFronter())
geolookup.Configure(hqfd.NewDirectDomainFronter())
statserver.Configure(hqfd.NewDirectDomainFronter())
// Note we don't call Configure on analytics here, as that would
// result in an extra analytics call and double counting.
}
Expand Down

0 comments on commit e988fa7

Please sign in to comment.