summary refs log tree commit diff
path: root/synapse/handlers
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-04-05 13:04:36 +0100
committerErik Johnston <erik@matrix.org>2016-04-05 13:04:36 +0100
commitc2b429ab246fb699046615ee5793c781ed9d5227 (patch)
tree7c2ab70a06b1675e437d2e1f2f5552936a9aec20 /synapse/handlers
parentMerge pull request #691 from matrix-org/erikj/member (diff)
parentDon't backfill from self (diff)
downloadsynapse-c2b429ab246fb699046615ee5793c781ed9d5227.tar.xz
Merge pull request #693 from matrix-org/erikj/backfill_self
Don't backfill from self
Diffstat (limited to 'synapse/handlers')
-rw-r--r--synapse/handlers/federation.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 026ebe52be..eb02f0e000 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -284,6 +284,9 @@ class FederationHandler(BaseHandler):
     def backfill(self, dest, room_id, limit, extremities=[]):
         """ Trigger a backfill request to `dest` for the given `room_id`
         """
+        if dest == self.server_name:
+            raise SynapseError(400, "Can't backfill from self.")
+
         if not extremities:
             extremities = yield self.store.get_oldest_events_in_room(room_id)
 
@@ -450,7 +453,7 @@ class FederationHandler(BaseHandler):
 
         likely_domains = [
             domain for domain, depth in curr_domains
-            if domain is not self.server_name
+            if domain != self.server_name
         ]
 
         @defer.inlineCallbacks