1
0

Merge commit '4876af06d' into anoa/dinsic_release_1_18_x

* commit '4876af06d':
  Abort federation requests if the client disconnects early (#7930)
This commit is contained in:
Andrew Morgan
2020-08-03 17:39:44 -07:00
2 changed files with 7 additions and 0 deletions

1
changelog.d/7930.feature Normal file
View File

@@ -0,0 +1 @@
Abort federation requests where the client disconnects before the ratelimiter expires.

View File

@@ -339,6 +339,12 @@ class BaseFederationServlet(object):
if origin:
with ratelimiter.ratelimit(origin) as d:
await d
if request._disconnected:
logger.warning(
"client disconnected before we started processing "
"request"
)
return -1, None
response = await func(
origin, content, request.args, *args, **kwargs
)