Fixes crashes when asyncdispatch.adjustTimeout returns a negative value. (#11231)
This commit is contained in:
parent
2339542832
commit
d0b8724aa2
6 changed files with 22 additions and 7 deletions
|
|
@ -314,6 +314,14 @@ else:
|
|||
key.events = {}
|
||||
key.data = empty
|
||||
|
||||
proc verifySelectParams(timeout: int) =
|
||||
# Timeout of -1 means: wait forever
|
||||
# Anything higher is the time to wait in miliseconds.
|
||||
if timeout < -1:
|
||||
raise newException(
|
||||
ValueError, "Cannot select with a negative value, got " & $timeout
|
||||
)
|
||||
|
||||
when defined(linux):
|
||||
include ioselects/ioselectors_epoll
|
||||
elif bsdPlatform:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue