summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorDominik Picheta <dominikpicheta@googlemail.com>2014-12-26 19:47:25 +0000
committerDominik Picheta <dominikpicheta@googlemail.com>2014-12-26 19:47:25 +0000
commit32db6798a31acc8490d690e5a314fa646ea7168d (patch)
tree4b2af6041925eab18fadc5daa0c061fcc4a2ee96 /lib
parenta8771b30518c307aa537b122d07bc41426eccb24 (diff)
downloadNim-32db6798a31acc8490d690e5a314fa646ea7168d.tar.gz
Fixes asynchttpsever.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/asynchttpserver.nim2
-rw-r--r--lib/pure/asyncnet.nim4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/pure/asynchttpserver.nim b/lib/pure/asynchttpserver.nim
index 8439be590..0b18e6bcc 100644
--- a/lib/pure/asynchttpserver.nim
+++ b/lib/pure/asynchttpserver.nim
@@ -147,7 +147,7 @@ proc sendStatus(client: AsyncSocket, status: string): Future[void] =
 proc processClient(client: AsyncSocket, address: string,
                    callback: proc (request: Request):
                       Future[void] {.closure, gcsafe.}) {.async.} =
-  while not client.closed:
+  while not client.isClosed:
     # GET /path HTTP/1.1
     # Header: val
     # \n
diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim
index c489d179c..76b2bc46c 100644
--- a/lib/pure/asyncnet.nim
+++ b/lib/pure/asyncnet.nim
@@ -454,6 +454,10 @@ proc getFd*(socket: AsyncSocket): SocketHandle =
   ## Returns the socket's file descriptor.
   return socket.fd
 
+proc isClosed*(socket: AsyncSocket): bool =
+  ## Determines whether the socket has been closed.
+  return socket.closed
+
 when isMainModule:
   type
     TestCases = enum