summaryrefslogtreecommitdiff
path: root/pkg/standalone/bonafide/eip_service.go
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2019-07-22 17:47:08 +0200
committerRuben Pollan <meskio@sindominio.net>2019-08-16 22:58:46 +0200
commit1de7bb124a5e502945712ef34f924ca4d1d0ca45 (patch)
tree346cc319f8dc3013fc9b9e0654d19e0720d388e7 /pkg/standalone/bonafide/eip_service.go
parent35aaba1e0da53aed44a5741ca9a3a1e2de21baf5 (diff)
[feat] be able to use obfs4
Diffstat (limited to 'pkg/standalone/bonafide/eip_service.go')
-rw-r--r--pkg/standalone/bonafide/eip_service.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/pkg/standalone/bonafide/eip_service.go b/pkg/standalone/bonafide/eip_service.go
index 94e303d..c097e8a 100644
--- a/pkg/standalone/bonafide/eip_service.go
+++ b/pkg/standalone/bonafide/eip_service.go
@@ -78,11 +78,17 @@ func (b *Bonafide) fetchEipJSON() error {
case 200:
b.eip, err = decodeEIP3(resp.Body)
case 404:
+ buf := make([]byte, 128)
+ resp.Body.Read(buf)
+ log.Printf("Error fetching eip v3 json: %s", buf)
resp, err = b.client.Post(eip1API, "", nil)
if err != nil {
return err
}
defer resp.Body.Close()
+ if resp.StatusCode != 200 {
+ return fmt.Errorf("get eip json has failed with status: %s", resp.Status)
+ }
b.eip, err = decodeEIP1(resp.Body)
default:
@@ -108,6 +114,7 @@ func decodeEIP1(body io.Reader) (*eipService, error) {
decoder := json.NewDecoder(body)
err := decoder.Decode(&eip1)
if err != nil {
+ log.Printf("Error fetching eip v1 json: %v", err)
return nil, err
}