summary refs log tree commit diff
path: root/synapse/federation
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-02-17 15:15:07 +0000
committerErik Johnston <erik@matrix.org>2015-02-17 15:15:07 +0000
commitc02da58a9da5c617c80fbeb7205f163e7b410c6f (patch)
tree8b166570eb2cbbecb7640d92d072f31add922535 /synapse/federation
parentConsume errors in time_bound_deferred (diff)
parentMerge pull request #74 from matrix-org/federation_min_depth_fix (diff)
downloadsynapse-c02da58a9da5c617c80fbeb7205f163e7b410c6f.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into failures
Diffstat (limited to 'synapse/federation')
-rw-r--r--synapse/federation/federation_server.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py
index d1ec0b9eac..679fb141e7 100644
--- a/synapse/federation/federation_server.py
+++ b/synapse/federation/federation_server.py
@@ -348,7 +348,6 @@ class FederationServer(FederationBase):
         )
         if already_seen:
             logger.debug("Already seen pdu %s", pdu.event_id)
-            defer.returnValue({})
             return
 
         # Check signature.
@@ -391,7 +390,13 @@ class FederationServer(FederationBase):
                 pdu.room_id, min_depth
             )
 
-            if min_depth and pdu.depth > min_depth and max_recursion > 0:
+            if min_depth and pdu.depth < min_depth:
+                # This is so that we don't notify the user about this
+                # message, to work around the fact that some events will
+                # reference really really old events we really don't want to
+                # send to the clients.
+                pdu.internal_metadata.outlier = True
+            elif min_depth and pdu.depth > min_depth and max_recursion > 0:
                 for event_id, hashes in pdu.prev_events:
                     if event_id not in have_seen:
                         logger.debug(
@@ -442,7 +447,7 @@ class FederationServer(FederationBase):
             except:
                 logger.warn("Failed to get state for event: %s", pdu.event_id)
 
-        ret = yield self.handler.on_receive_pdu(
+        yield self.handler.on_receive_pdu(
             origin,
             pdu,
             backfilled=False,
@@ -450,8 +455,6 @@ class FederationServer(FederationBase):
             auth_chain=auth_chain,
         )
 
-        defer.returnValue(ret)
-
     def __str__(self):
         return "<ReplicationLayer(%s)>" % self.server_name