0 is also valid FD.

This commit is contained in:
Itamar Turner-Trauring 2023-01-10 11:04:22 -05:00
parent 7c506057b5
commit ccb5956645
1 changed files with 1 additions and 1 deletions

View File

@ -572,7 +572,7 @@ class HTTPServer(object):
fd = request.content.fileno()
except (ValueError, OSError):
fd = -1
if fd > 0 and not PYCDDL_BYTES_ONLY:
if fd >= 0 and not PYCDDL_BYTES_ONLY:
# It's a file, so we can use mmap() to save memory.
message = mmap.mmap(fd, 0, access=mmap.ACCESS_READ)
else: