mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2024-12-30 07:06:10 -05:00
Merge pull request #74 from matrix-org/federation_min_depth_fix
Federation min depth fix
This commit is contained in:
commit
bfffd2e108
@ -331,7 +331,6 @@ class FederationServer(FederationBase):
|
|||||||
)
|
)
|
||||||
if already_seen:
|
if already_seen:
|
||||||
logger.debug("Already seen pdu %s", pdu.event_id)
|
logger.debug("Already seen pdu %s", pdu.event_id)
|
||||||
defer.returnValue({})
|
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check signature.
|
# Check signature.
|
||||||
@ -367,7 +366,13 @@ class FederationServer(FederationBase):
|
|||||||
pdu.room_id, min_depth
|
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:
|
for event_id, hashes in pdu.prev_events:
|
||||||
if event_id not in have_seen:
|
if event_id not in have_seen:
|
||||||
logger.debug(
|
logger.debug(
|
||||||
@ -418,7 +423,7 @@ class FederationServer(FederationBase):
|
|||||||
except:
|
except:
|
||||||
logger.warn("Failed to get state for event: %s", pdu.event_id)
|
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,
|
origin,
|
||||||
pdu,
|
pdu,
|
||||||
backfilled=False,
|
backfilled=False,
|
||||||
@ -426,8 +431,6 @@ class FederationServer(FederationBase):
|
|||||||
auth_chain=auth_chain,
|
auth_chain=auth_chain,
|
||||||
)
|
)
|
||||||
|
|
||||||
defer.returnValue(ret)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "<ReplicationLayer(%s)>" % self.server_name
|
return "<ReplicationLayer(%s)>" % self.server_name
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user