Skip to content

Commit

Permalink
Add header bytes to buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
ordinary-jamie committed Feb 16, 2024
1 parent 67d6bed commit 1bcea07
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Lib/asyncio/proactor_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def sendto(self, data, addr=None):

# Ensure that what we buffer is immutable.
self._buffer.append((bytes(data), addr))
self._buffer_size += len(data)
self._buffer_size += len(data) + 8 # include header bytes

if self._write_fut is None:
# No current write operations are active, kick one off
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/selector_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1276,7 +1276,7 @@ def sendto(self, data, addr=None):

# Ensure that what we buffer is immutable.
self._buffer.append((bytes(data), addr))
self._buffer_size += len(data)
self._buffer_size += len(data) + 8 # include header bytes
self._maybe_pause_protocol()

def _sendto_ready(self):
Expand Down

0 comments on commit 1bcea07

Please sign in to comment.