Merge branch 'devel' of https://github.com/Araq/Nimrod into devel

This commit is contained in:
Araq
2014-01-19 20:25:03 +01:00
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

View File

@@ -346,7 +346,7 @@ proc poll*(irc: PIRC, ev: var TIRCEvent,
var line = TaintedString""
var socks = @[irc.sock]
var ret = socks.select(timeout)
if socks.len() == 0 and ret != 0:
if socks.len() != 0 and ret != 0:
irc.sock.readLine(line)
ev = irc.processLine(line.string)
result = true

View File

@@ -800,7 +800,7 @@ elif not defined(useNimRtl):
var i = 0
var L = s.len
while i < L:
if FD_ISSET(cint(s[i].outHandle), fd) != 0'i32:
if FD_ISSET(cint(s[i].outHandle), fd) == 0'i32:
s[i] = s[L-1]
dec(L)
else:

View File

@@ -119,7 +119,7 @@ proc next*(s: var TScgistate, timeout: int = -1): bool =
## request, if ``timeout`` is `-1` then this function will never time out.
## Returns `True` if a new request has been processed.
var rsocks = @[s.server]
if select(rsocks, timeout) == 1 and rsocks.len == 0:
if select(rsocks, timeout) == 1 and rsocks.len == 1:
new(s.client)
accept(s.server, s.client)
var L = 0

View File

@@ -928,7 +928,7 @@ proc pruneSocketSet(s: var seq[TSocket], fd: var TFdSet) =
var i = 0
var L = s.len
while i < L:
if FD_ISSET(s[i].fd, fd) != 0'i32:
if FD_ISSET(s[i].fd, fd) == 0'i32:
s[i] = s[L-1]
dec(L)
else: