diff options
author | Erik Johnston <erik@matrix.org> | 2016-09-01 10:55:02 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2016-09-01 10:55:02 +0100 |
commit | 516a272aca16670961c3d337a152ce507371c0cd (patch) | |
tree | e941fb08b0017037310bc1780c6b67cb18be0483 /synapse | |
parent | Merge branch 'release-v0.17.1' of github.com:matrix-org/synapse (diff) | |
download | synapse-516a272aca16670961c3d337a152ce507371c0cd.tar.xz |
Ensure we only return a validated pdu in get_pdu
Diffstat (limited to 'synapse')
-rw-r--r-- | synapse/federation/federation_client.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py index f2b3aceb49..7212903eac 100644 --- a/synapse/federation/federation_client.py +++ b/synapse/federation/federation_client.py @@ -267,7 +267,7 @@ class FederationClient(FederationBase): pdu_attempts = self.pdu_destination_tried.setdefault(event_id, {}) - pdu = None + signed_pdu = None for destination in destinations: now = self._clock.time_msec() last_attempt = pdu_attempts.get(destination, 0) @@ -297,7 +297,7 @@ class FederationClient(FederationBase): pdu = pdu_list[0] # Check signatures are correct. - pdu = yield self._check_sigs_and_hashes([pdu])[0] + signed_pdu = yield self._check_sigs_and_hashes([pdu])[0] break @@ -320,10 +320,10 @@ class FederationClient(FederationBase): ) continue - if self._get_pdu_cache is not None and pdu: - self._get_pdu_cache[event_id] = pdu + if self._get_pdu_cache is not None and signed_pdu: + self._get_pdu_cache[event_id] = signed_pdu - defer.returnValue(pdu) + defer.returnValue(signed_pdu) @defer.inlineCallbacks @log_function |