aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2016-01-17 19:19:54 +0100
committerDimitri Sokolyuk <demon@dim13.org>2016-01-17 19:19:54 +0100
commitb55706fa1fc947ab798016dcbedf09d3c063e5cb (patch)
treeea4f52f82b5aa0f984e8dcb69ffedfb1060c5d7c
parente7174c090a23fe437d717d01fce44196305dea5f (diff)
Consume unused nonces
-rw-r--r--README.md1
-rw-r--r--provider.go4
2 files changed, 5 insertions, 0 deletions
diff --git a/README.md b/README.md
index a04c520..b418b52 100644
--- a/README.md
+++ b/README.md
@@ -94,5 +94,6 @@ slogin -R \*:80:localhost:8080 -N root@docker.moccu.com
# redesign
+- provider -> nonce
- account -> signer
- desire -> map[domain]signer
diff --git a/provider.go b/provider.go
index 755e8c6..ef7d85a 100644
--- a/provider.go
+++ b/provider.go
@@ -41,6 +41,10 @@ func (p Provider) nonce(resp *http.Response) {
p.nonces <- rn
}
log.Println("# nonces", len(p.nonces))
+ for len(p.nonces) > 10 {
+ <-p.nonces
+ }
+ log.Println("# nonces", len(p.nonces))
}
// NewProvider fetches directory and initializes nonce