mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-18 02:30:29 -04:00
Merge remote-tracking branch 'upstream/release-v1.60'
This commit is contained in:
commit
121950d34d
11 changed files with 138 additions and 17 deletions
|
@ -225,6 +225,7 @@ async def _handle_response(
|
|||
if max_response_size is None:
|
||||
max_response_size = MAX_RESPONSE_SIZE
|
||||
|
||||
finished = False
|
||||
try:
|
||||
check_content_type_is(response.headers, parser.CONTENT_TYPE)
|
||||
|
||||
|
@ -233,6 +234,7 @@ async def _handle_response(
|
|||
|
||||
length = await make_deferred_yieldable(d)
|
||||
|
||||
finished = True
|
||||
value = parser.finish()
|
||||
except BodyExceededMaxSize as e:
|
||||
# The response was too big.
|
||||
|
@ -283,6 +285,15 @@ async def _handle_response(
|
|||
e,
|
||||
)
|
||||
raise
|
||||
finally:
|
||||
if not finished:
|
||||
# There was an exception and we didn't `finish()` the parse.
|
||||
# Let the parser know that it can free up any resources.
|
||||
try:
|
||||
parser.finish()
|
||||
except Exception:
|
||||
# Ignore any additional exceptions.
|
||||
pass
|
||||
|
||||
time_taken_secs = reactor.seconds() - start_ms / 1000
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue