summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-24 12:56:17 +0000
committerErik Johnston <erik@matrix.org>2014-11-24 12:56:17 +0000
commit4bd0ab76c69b8f4861de26894f8e50407e9fc87f (patch)
treeefb13721713d72d91d8f6c7e6574db2a9c6be875 /synapse/federation
parentSYN-163: Add an order by rowid to selects. (diff)
downloadsynapse-4bd0ab76c69b8f4861de26894f8e50407e9fc87f.tar.xz
We don't always want to Auth get_persisted_pdu
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/replication.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/synapse/federation/replication.py b/synapse/federation/replication.py
index 124dc31225..4cd17bdb9c 100644
--- a/synapse/federation/replication.py
+++ b/synapse/federation/replication.py
@@ -504,13 +504,15 @@ class ReplicationLayer(object):
         defer.returnValue(self.event_from_pdu_json(pdu_dict))
 
     @log_function
-    def _get_persisted_pdu(self, origin, event_id):
+    def _get_persisted_pdu(self, origin, event_id, do_auth=True):
         """ Get a PDU from the database with given origin and id.
 
         Returns:
             Deferred: Results in a `Pdu`.
         """
-        return self.handler.get_persisted_pdu(origin, event_id)
+        return self.handler.get_persisted_pdu(
+            origin, event_id, do_auth=do_auth
+        )
 
     def _transaction_from_pdus(self, pdu_list):
         """Returns a new Transaction containing the given PDUs suitable for
@@ -529,7 +531,9 @@ class ReplicationLayer(object):
     @log_function
     def _handle_new_pdu(self, origin, pdu, backfilled=False):
         # We reprocess pdus when we have seen them only as outliers
-        existing = yield self._get_persisted_pdu(origin, pdu.event_id)
+        existing = yield self._get_persisted_pdu(
+            origin, pdu.event_id, do_auth=False
+        )
 
         if existing and (not existing.outlier or pdu.outlier):
             logger.debug("Already seen pdu %s", pdu.event_id)
@@ -547,7 +551,11 @@ class ReplicationLayer(object):
 
             if min_depth and pdu.depth > min_depth:
                 for event_id, hashes in pdu.prev_events:
-                    exists = yield self._get_persisted_pdu(origin, event_id)
+                    exists = yield self._get_persisted_pdu(
+                        origin,
+                        event_id,
+                        do_auth=False
+                    )
 
                     if not exists:
                         logger.debug("Requesting pdu %s", event_id)