diff options
author | Jakob Borg <jakob@nym.se> | 2014-06-12 01:11:04 +0200 |
---|---|---|
committer | Jakob Borg <jakob@nym.se> | 2014-06-12 01:11:04 +0200 |
commit | 3c6738da73f64341a1e6df6d768ca136cac951e3 (patch) | |
tree | fb0efc77b837968d266828662ea0863a9345d838 /cmd | |
parent | 18e5cb67937c8cc31432add517f145502584c318 (diff) |
Limit damage of previous commit to ARM arch
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/syncthing/usage_report.go | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/cmd/syncthing/usage_report.go b/cmd/syncthing/usage_report.go index 612428b9f0..d22f089bc0 100644 --- a/cmd/syncthing/usage_report.go +++ b/cmd/syncthing/usage_report.go @@ -69,13 +69,16 @@ func sendUsageReport(m *model.Model) error { var b bytes.Buffer json.NewEncoder(&b).Encode(d) - // This works around the lack of DNS resolution on Android... :() - tr := &http.Transport{ - Dial: func(network, addr string) (net.Conn, error) { - return net.Dial(network, "194.126.249.13:443") - }, + var client = http.DefaultClient + if runtime.GOARCH == "arm" { + // This works around the lack of DNS resolution on Android... :( + tr := &http.Transport{ + Dial: func(network, addr string) (net.Conn, error) { + return net.Dial(network, "194.126.249.13:443") + }, + } + client = &http.Client{Transport: tr} } - client := &http.Client{Transport: tr} _, err := client.Post("https://data.syncthing.net/newdata", "application/json", &b) return err } |