more things case consistent
This commit is contained in:
parent
5d93957048
commit
007d17ce3f
3 changed files with 7 additions and 8 deletions
|
|
@ -167,7 +167,7 @@ proc asyncSocket*(domain: TDomain = AF_INET, typ: TType = SOCK_STREAM,
|
||||||
result = newAsyncSocket()
|
result = newAsyncSocket()
|
||||||
result.socket = socket(domain, typ, protocol, buffered)
|
result.socket = socket(domain, typ, protocol, buffered)
|
||||||
result.proto = protocol
|
result.proto = protocol
|
||||||
if result.socket == InvalidSocket: OSError(OSLastError())
|
if result.socket == invalidSocket: osError(osLastError())
|
||||||
result.socket.setBlocking(false)
|
result.socket.setBlocking(false)
|
||||||
|
|
||||||
proc toAsyncSocket*(sock: TSocket, state: TInfo = SockConnected): PAsyncSocket =
|
proc toAsyncSocket*(sock: TSocket, state: TInfo = SockConnected): PAsyncSocket =
|
||||||
|
|
@ -357,7 +357,7 @@ proc acceptAddr*(server: PAsyncSocket, client: var PAsyncSocket,
|
||||||
client.sslNeedAccept = false
|
client.sslNeedAccept = false
|
||||||
client.info = SockConnected
|
client.info = SockConnected
|
||||||
|
|
||||||
if c == InvalidSocket: SocketError(server.socket)
|
if c == invalidSocket: socketError(server.socket)
|
||||||
c.setBlocking(false) # TODO: Needs to be tested.
|
c.setBlocking(false) # TODO: Needs to be tested.
|
||||||
|
|
||||||
# deleg.open is set in ``toDelegate``.
|
# deleg.open is set in ``toDelegate``.
|
||||||
|
|
@ -481,7 +481,7 @@ proc recvLine*(s: PAsyncSocket, line: var TaintedString): bool {.deprecated.} =
|
||||||
of RecvDisconnected:
|
of RecvDisconnected:
|
||||||
result = true
|
result = true
|
||||||
of RecvFail:
|
of RecvFail:
|
||||||
s.SocketError(async = true)
|
s.socketError(async = true)
|
||||||
result = false
|
result = false
|
||||||
{.pop.}
|
{.pop.}
|
||||||
|
|
||||||
|
|
@ -615,11 +615,11 @@ proc poll*(d: PDispatcher, timeout: int = 500): bool =
|
||||||
if d.hasDataBuffered(d.deleVal):
|
if d.hasDataBuffered(d.deleVal):
|
||||||
hasDataBufferedCount.inc()
|
hasDataBufferedCount.inc()
|
||||||
d.handleRead(d.deleVal)
|
d.handleRead(d.deleVal)
|
||||||
if hasDataBufferedCount > 0: return True
|
if hasDataBufferedCount > 0: return true
|
||||||
|
|
||||||
if readDg.len() == 0 and writeDg.len() == 0:
|
if readDg.len() == 0 and writeDg.len() == 0:
|
||||||
## TODO: Perhaps this shouldn't return if errorDg has something?
|
## TODO: Perhaps this shouldn't return if errorDg has something?
|
||||||
return False
|
return false
|
||||||
|
|
||||||
if select(readDg, writeDg, errorDg, timeout) != 0:
|
if select(readDg, writeDg, errorDg, timeout) != 0:
|
||||||
for i in 0..len(d.delegates)-1:
|
for i in 0..len(d.delegates)-1:
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ when withThreads:
|
||||||
|
|
||||||
proc hookAux(st: TStackTrace, costs: int) =
|
proc hookAux(st: TStackTrace, costs: int) =
|
||||||
# this is quite performance sensitive!
|
# this is quite performance sensitive!
|
||||||
when withThreads: Acquire profilingLock
|
when withThreads: acquire profilingLock
|
||||||
inc totalCalls
|
inc totalCalls
|
||||||
var last = high(st)
|
var last = high(st)
|
||||||
while last > 0 and isNil(st[last]): dec last
|
while last > 0 and isNil(st[last]): dec last
|
||||||
|
|
@ -106,7 +106,7 @@ proc hookAux(st: TStackTrace, costs: int) =
|
||||||
h = ((5 * h) + 1) and high(profileData)
|
h = ((5 * h) + 1) and high(profileData)
|
||||||
inc chain
|
inc chain
|
||||||
maxChainLen = max(maxChainLen, chain)
|
maxChainLen = max(maxChainLen, chain)
|
||||||
when withThreads: Release profilingLock
|
when withThreads: release profilingLock
|
||||||
|
|
||||||
when defined(memProfiler):
|
when defined(memProfiler):
|
||||||
const
|
const
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -4,7 +4,6 @@ version 0.9.4
|
||||||
- fix GC issues
|
- fix GC issues
|
||||||
- fix macros\tstringinterp.nim
|
- fix macros\tstringinterp.nim
|
||||||
- test and fix showoff
|
- test and fix showoff
|
||||||
- fix closure iterators
|
|
||||||
|
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue