using transmitfile for sendfile on windows

This commit is contained in:
AN Long 2023-11-23 22:26:20 +08:00
parent f94935df16
commit 87c88faa88
2 changed files with 3 additions and 0 deletions

View file

@ -514,6 +514,8 @@ def sendfile(self, file, offset=0, count=None):
The socket must be of SOCK_STREAM type.
Non-blocking sockets are not supported.
"""
if sys.platform == "win32":
return self._sendfile_use_transmitfile(file, offset, count)
try:
return self._sendfile_use_sendfile(file, offset, count)
except _GiveupOnSendfile: