Skip to content

Commit

Permalink
Logging message when no fronted servers available
Browse files Browse the repository at this point in the history
  • Loading branch information
oxtoacart committed Feb 18, 2015
1 parent 4bb97f6 commit 657a701
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/github.com/getlantern/flashlight/client/balancer.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package client

import (
"math"

"github.com/getlantern/balancer"
"github.com/getlantern/fronted"
)
Expand All @@ -16,7 +18,7 @@ func (client *Client) initBalancer(cfg *ClientConfig) *balancer.Balancer {

log.Debugf("Adding %d domain fronted servers", len(cfg.FrontedServers))
var highestQOSFrontedDialer fronted.Dialer
highestQOS := -1
highestQOS := math.MinInt32
for _, s := range cfg.FrontedServers {
fd, dialer := s.dialer(cfg.MasqueradeSets)
dialers = append(dialers, dialer)
Expand All @@ -26,7 +28,9 @@ func (client *Client) initBalancer(cfg *ClientConfig) *balancer.Balancer {
}

if highestQOSFrontedDialer != nil {
go determinePublicIp(highestQOSFrontedDialer)
go lookupPublicIp(highestQOSFrontedDialer)
} else {
log.Debugf("No fronted dialers found, unable to look up public ip")
}

log.Debugf("Adding %d chained servers", len(cfg.ChainedServers))
Expand Down
2 changes: 1 addition & 1 deletion src/github.com/getlantern/flashlight/client/publicip.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/getlantern/fronted"
)

func determinePublicIp(fd fronted.Dialer) {
func lookupPublicIp(fd fronted.Dialer) {
client := fd.DirectHttpClient()
resp, err := client.Get("http://geo.getiantem.org/lookup")
if err != nil {
Expand Down

0 comments on commit 657a701

Please sign in to comment.