0 is also valid FD.
This commit is contained in:
parent
7c506057b5
commit
ccb5956645
|
@ -572,7 +572,7 @@ class HTTPServer(object):
|
||||||
fd = request.content.fileno()
|
fd = request.content.fileno()
|
||||||
except (ValueError, OSError):
|
except (ValueError, OSError):
|
||||||
fd = -1
|
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.
|
# It's a file, so we can use mmap() to save memory.
|
||||||
message = mmap.mmap(fd, 0, access=mmap.ACCESS_READ)
|
message = mmap.mmap(fd, 0, access=mmap.ACCESS_READ)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue