Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'erikj/fix_origin_check' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Sep 16, 2020
2 parents 576bc37 + 97659b7 commit 5dd051a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog.d/8324.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix fetching events from remote servers that are malformed.
7 changes: 4 additions & 3 deletions synapse/federation/federation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
from synapse.federation.federation_base import FederationBase, event_from_pdu_json
from synapse.logging.context import make_deferred_yieldable, preserve_fn
from synapse.logging.utils import log_function
from synapse.types import JsonDict
from synapse.types import JsonDict, get_domain_from_id
from synapse.util import unwrapFirstError
from synapse.util.caches.expiringcache import ExpiringCache
from synapse.util.retryutils import NotRetryingDestination
Expand Down Expand Up @@ -386,10 +386,11 @@ async def handle_check_result(pdu: EventBase, deferred: Deferred):
pdu.event_id, allow_rejected=True, allow_none=True
)

if not res and pdu.origin != origin:
pdu_origin = get_domain_from_id(pdu.sender)
if not res and pdu_origin != origin:
try:
res = await self.get_pdu(
destinations=[pdu.origin],
destinations=[pdu_origin],
event_id=pdu.event_id,
room_version=room_version,
outlier=outlier,
Expand Down

0 comments on commit 5dd051a

Please sign in to comment.