mirror of
https://git.anonymousland.org/anonymousland/synapse-product.git
synced 2024-12-22 01:34:58 -05:00
Yield on EDU handling
This commit is contained in:
parent
384ee6eafb
commit
3c5f25507b
@ -137,8 +137,8 @@ class FederationServer(FederationBase):
|
|||||||
logger.exception("Failed to handle PDU")
|
logger.exception("Failed to handle PDU")
|
||||||
|
|
||||||
if hasattr(transaction, "edus"):
|
if hasattr(transaction, "edus"):
|
||||||
for edu in [Edu(**x) for x in transaction.edus]:
|
for edu in (Edu(**x) for x in transaction.edus):
|
||||||
self.received_edu(
|
yield self.received_edu(
|
||||||
transaction.origin,
|
transaction.origin,
|
||||||
edu.edu_type,
|
edu.edu_type,
|
||||||
edu.content
|
edu.content
|
||||||
@ -161,11 +161,12 @@ class FederationServer(FederationBase):
|
|||||||
)
|
)
|
||||||
defer.returnValue((200, response))
|
defer.returnValue((200, response))
|
||||||
|
|
||||||
|
@defer.inlineCallbacks
|
||||||
def received_edu(self, origin, edu_type, content):
|
def received_edu(self, origin, edu_type, content):
|
||||||
received_edus_counter.inc()
|
received_edus_counter.inc()
|
||||||
|
|
||||||
if edu_type in self.edu_handlers:
|
if edu_type in self.edu_handlers:
|
||||||
self.edu_handlers[edu_type](origin, content)
|
yield self.edu_handlers[edu_type](origin, content)
|
||||||
else:
|
else:
|
||||||
logger.warn("Received EDU of type %s with no handler", edu_type)
|
logger.warn("Received EDU of type %s with no handler", edu_type)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user