Fixes asynchttpsever.
This commit is contained in:
parent
a8771b3051
commit
32db6798a3
2 changed files with 5 additions and 1 deletions
|
|
@ -147,7 +147,7 @@ proc sendStatus(client: AsyncSocket, status: string): Future[void] =
|
||||||
proc processClient(client: AsyncSocket, address: string,
|
proc processClient(client: AsyncSocket, address: string,
|
||||||
callback: proc (request: Request):
|
callback: proc (request: Request):
|
||||||
Future[void] {.closure, gcsafe.}) {.async.} =
|
Future[void] {.closure, gcsafe.}) {.async.} =
|
||||||
while not client.closed:
|
while not client.isClosed:
|
||||||
# GET /path HTTP/1.1
|
# GET /path HTTP/1.1
|
||||||
# Header: val
|
# Header: val
|
||||||
# \n
|
# \n
|
||||||
|
|
|
||||||
|
|
@ -454,6 +454,10 @@ proc getFd*(socket: AsyncSocket): SocketHandle =
|
||||||
## Returns the socket's file descriptor.
|
## Returns the socket's file descriptor.
|
||||||
return socket.fd
|
return socket.fd
|
||||||
|
|
||||||
|
proc isClosed*(socket: AsyncSocket): bool =
|
||||||
|
## Determines whether the socket has been closed.
|
||||||
|
return socket.closed
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
type
|
type
|
||||||
TestCases = enum
|
TestCases = enum
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue