summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-01 14:40:36 +0100
committerErik Johnston <erik@matrix.org>2016-09-01 14:40:36 +0100
commitf4778d4cd98d3ca3911107f1889c3c44d7c9b4c6 (patch)
tree1fc7fa463e445b2f72a9ada2013f4e36ecb3993b /synapse
parentMerge pull request #1060 from matrix-org/erikj/state_ids (diff)
parentEnsure we only return a validated pdu in get_pdu (diff)
downloadsynapse-f4778d4cd98d3ca3911107f1889c3c44d7c9b4c6.tar.xz
Merge branch 'erikj/pdu_check' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'synapse')
-rw-r--r--synapse/federation/federation_client.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/synapse/federation/federation_client.py b/synapse/federation/federation_client.py
index 67ad3dfd37..627acc6a4f 100644
--- a/synapse/federation/federation_client.py
+++ b/synapse/federation/federation_client.py
@@ -269,7 +269,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)
@@ -299,7 +299,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
 
@@ -322,10 +322,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