Fixes bug in scgi module: client socket was not initialised properly.

This commit is contained in:
Dominik Picheta
2012-11-18 11:21:51 +00:00
parent 1c17d3e841
commit ddf4449442

View File

@@ -101,6 +101,7 @@ proc next*(s: var TScgistate, timeout: int = -1): bool =
## Returns `True` if a new request has been processed.
var rsocks = @[s.server]
if select(rsocks, timeout) == 1 and rsocks.len == 0:
new(s.client)
accept(s.server, s.client)
var L = 0
while true:
@@ -143,7 +144,7 @@ proc run*(handleRequest: proc (client: TSocket, input: string,
# -- AsyncIO start
proc handleAccept(sock: PAsyncSocket, s: PAsyncScgiState) =
new(s.client)
accept(getSocket(s.asyncServer), s.client)
var L = 0
while true: