Skip to content

Commit e2377b5

Browse files
committed
bail after, not at, max size
1 parent 94d9617 commit e2377b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

synapse/http/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def dataReceived(self, data: bytes) -> None:
10341034
# The first time the maximum size is exceeded, error and cancel the
10351035
# connection. dataReceived might be called again if data was received
10361036
# in the meantime.
1037-
if self.max_size is not None and self.length >= self.max_size:
1037+
if self.max_size is not None and self.length > self.max_size:
10381038
self.deferred.errback(BodyExceededMaxSize())
10391039
# Close the connection (forcefully) since all the data will get
10401040
# discarded anyway.

0 commit comments

Comments
 (0)