diff options
author | Richard van der Hoff <richard@matrix.org> | 2018-05-01 18:16:57 +0100 |
---|---|---|
committer | Richard van der Hoff <richard@matrix.org> | 2018-05-01 18:16:57 +0100 |
commit | ca7211104e0f6d08ea4f25de7b6e42e3839045d3 (patch) | |
tree | 212caa7daf269b4592ea3a35d5caf5ff2d42252e /synapse/handlers | |
parent | Fixes #3135 - Replace _OpenSSLECCurve with crypto.get_elliptic_curve (#3157) (diff) | |
parent | Merge commit '33f469b' into release-v0.28.1 (diff) | |
download | synapse-ca7211104e0f6d08ea4f25de7b6e42e3839045d3.tar.xz |
Merge branch 'release-v0.28.1' into develop
Diffstat (limited to 'synapse/handlers')
-rw-r--r-- | synapse/handlers/message.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/handlers/message.py b/synapse/handlers/message.py index 23502eda70..b793fc4df7 100644 --- a/synapse/handlers/message.py +++ b/synapse/handlers/message.py @@ -22,7 +22,7 @@ import six from twisted.internet import defer, reactor from twisted.python.failure import Failure -from synapse.api.constants import EventTypes, Membership +from synapse.api.constants import EventTypes, Membership, MAX_DEPTH from synapse.api.errors import AuthError, Codes, SynapseError from synapse.crypto.event_signing import add_hashes_and_signatures from synapse.events.utils import serialize_event @@ -625,6 +625,10 @@ class EventCreationHandler(object): if prev_events_and_hashes: depth = max([d for _, _, d in prev_events_and_hashes]) + 1 + # we cap depth of generated events, to ensure that they are not + # rejected by other servers (and so that they can be persisted in + # the db) + depth = min(depth, MAX_DEPTH) else: depth = 1 |