aboutsummaryrefslogtreecommitdiff
path: root/provider.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-08 18:43:47 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-08 18:43:47 +0100
commitb71c6eb7538f45453c89e7e1d84ca967ee5c7b84 (patch)
tree7d671aec8682bd579f542cc7f7d440f04851bc0f /provider.go
parent57a7772122b6a87ba67a534ba7346f1472e72cc4 (diff)
Retry-After
Diffstat (limited to 'provider.go')
-rw-r--r--provider.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/provider.go b/provider.go
index a865ce8..8529044 100644
--- a/provider.go
+++ b/provider.go
@@ -246,6 +246,7 @@ func (p *Provider) Authorize(s ThumbSigner, d *Desire) error {
if err != nil {
return err
}
+ log.Println("combination", com)
for _, n := range com {
ch := r.Challenges[n]
@@ -274,14 +275,13 @@ func (p *Provider) Authorize(s ThumbSigner, d *Desire) error {
}
defer sol.Finish()
- for {
- done, err := p.queryStatus(ns.Location)
+ var done bool
+ for !done {
+ done, err = p.queryStatus(ns.Location)
if err != nil {
return err
}
- if done {
- break
- }
+ time.Sleep(time.Second * 5)
}
}
}
@@ -289,6 +289,7 @@ func (p *Provider) Authorize(s ThumbSigner, d *Desire) error {
}
func (p *Provider) queryStatus(url string) (bool, error) {
+ log.Println("query", url)
r := &Challenge{}
resp, err := p.Get(url)
if err != nil {