Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add header bytes to buffer size
  • Loading branch information
ordinary-jamie committed Feb 16, 2024
commit 1bcea07c09e70ca8f2496a69f9bfff52677a7c88
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