Corrected prunesocketset and pruneprocessset

fd sets passed to select() were pruning ready FDs rather than pruning
UN-ready FDs.
This commit is contained in:
Erik O'Leary 2014-01-19 10:51:21 -06:00
commit 5d8d1ed8bc
5 changed files with 6 additions and 6 deletions

View file

@ -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