Fix concurrent server_key requests (#2458)

Fix a bug where we could end up firing off multiple requests for server_keys
for the same server at the same time.
This commit is contained in:
Richard van der Hoff 2017-09-19 23:25:44 +01:00 committed by GitHub
parent aa620d09a0
commit 9864efa532
2 changed files with 58 additions and 4 deletions

View file

@ -201,7 +201,9 @@ class Keyring(object):
server_name = verify_request.server_name
request_id = id(verify_request)
server_to_request_ids.setdefault(server_name, set()).add(request_id)
deferred.addBoth(remove_deferreds, server_name, verify_request)
verify_request.deferred.addBoth(
remove_deferreds, server_name, verify_request,
)
# Pass those keys to handle_key_deferred so that the json object
# signatures can be verified