Skip to content

Commit b73f6e3

Browse files
pdedtauerbach
authored andcommitted
Don't delay an unbounded number of submissions
1 parent 47df152 commit b73f6e3

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/components/ssl-observatory.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -546,11 +546,15 @@ SSLObservatory.prototype = {
546546
// only try to submit now if there aren't too many outstanding requests
547547
if (this.current_outstanding_requests > MAX_OUTSTANDING) {
548548
this.log(WARN, "Too many outstanding requests ("+this.current_outstanding_requests+"), not submitting");
549-
if (!(c.fps[0] in this.delayed_submissions)) {
550-
this.log(WARN, "Planning to retry submission...");
551-
let retry = function() { this.submitChain(certArray, fps, domain, channel, host_ip, true); };
552-
this.delayed_submissions[c.fps[0]] = retry;
553-
}
549+
550+
// if there are too many current requests but not too many
551+
// delayed/pending ones, then delay this one
552+
if (Object.keys(this.delayed_submissions).length < MAX_DELAYED)
553+
if (!(c.fps[0] in this.delayed_submissions)) {
554+
this.log(WARN, "Planning to retry submission...");
555+
let retry = function() { this.submitChain(certArray, fps, domain, channel, host_ip, true); };
556+
this.delayed_submissions[c.fps[0]] = retry;
557+
}
554558
return;
555559
}
556560

0 commit comments

Comments
 (0)