diff options
author | Erik Johnston <erik@matrix.org> | 2015-02-17 09:48:23 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-02-17 09:48:23 +0000 |
commit | 0194e71e9956087e2352eae3126c98877255d2e6 (patch) | |
tree | b431749bcbfb4763cc325a1e2da66087ebe1b944 /synapse | |
parent | Cache results of get_pdu. (diff) | |
parent | Merge pull request #74 from matrix-org/federation_min_depth_fix (diff) | |
download | synapse-0194e71e9956087e2352eae3126c98877255d2e6.tar.xz |
Merge branch 'develop' of github.com:matrix-org/synapse into get_pdu_limiting
Diffstat (limited to '')
-rw-r--r-- | synapse/federation/federation_server.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/synapse/federation/federation_server.py b/synapse/federation/federation_server.py index 9f5c98694c..4391a60c02 100644 --- a/synapse/federation/federation_server.py +++ b/synapse/federation/federation_server.py @@ -331,7 +331,6 @@ class FederationServer(FederationBase): ) if already_seen: logger.debug("Already seen pdu %s", pdu.event_id) - defer.returnValue({}) return # Check signature. @@ -367,7 +366,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( @@ -418,7 +423,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, @@ -426,8 +431,6 @@ class FederationServer(FederationBase): auth_chain=auth_chain, ) - defer.returnValue(ret) - def __str__(self): return "<ReplicationLayer(%s)>" % self.server_name |