Corrected prunesocketset and pruneprocessset
fd sets passed to select() were pruning ready FDs rather than pruning UN-ready FDs.
This commit is contained in:
parent
73c6efdf66
commit
5d8d1ed8bc
5 changed files with 6 additions and 6 deletions
|
|
@ -298,7 +298,7 @@ proc getLines(ftp: PFTPClient, async: bool = false): bool =
|
|||
var readSocks: seq[TSocket] = @[ftp.getCSock()]
|
||||
# This is only needed here. Asyncio gets this socket...
|
||||
blockingOperation(ftp.getCSock()):
|
||||
if readSocks.select(1) != 0 and ftp.getCSock() notin readSocks:
|
||||
if readSocks.select(1) != 0 and ftp.getCSock() in readSocks:
|
||||
assertReply ftp.expectReply(), "226"
|
||||
return true
|
||||
|
||||
|
|
@ -434,7 +434,7 @@ proc getFile(ftp: PFTPClient, async = false): bool =
|
|||
if not async:
|
||||
var readSocks: seq[TSocket] = @[ftp.getCSock()]
|
||||
blockingOperation(ftp.getCSock()):
|
||||
if readSocks.select(1) != 0 and ftp.getCSock() notin readSocks:
|
||||
if readSocks.select(1) != 0 and ftp.getCSock() in readSocks:
|
||||
assertReply ftp.expectReply(), "226"
|
||||
return true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue