summary refs log tree commit diff stats
path: root/lib/pure/net.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2015-02-11 17:42:28 +0100
committerAraq <rumpf_a@web.de>2015-02-12 14:56:56 +0100
commit10335fd7264560e9b5a6ca4b2b5fe8e28e78209b (patch)
treeec008f73094727629bac6bc809a11b294f878371 /lib/pure/net.nim
parent4f00ae5a5afd0702a286a31f6bbdbdd8745be8c5 (diff)
downloadNim-10335fd7264560e9b5a6ca4b2b5fe8e28e78209b.tar.gz
fixed minor bugs; cleaned up tests
Diffstat (limited to 'lib/pure/net.nim')
-rw-r--r--lib/pure/net.nim9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index 4eacfea78..2b81b6fb0 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -321,7 +321,8 @@ proc bindAddr*(socket: Socket, port = Port(0), address = "") {.
     dealloc(aiList)
 
 proc acceptAddr*(server: Socket, client: var Socket, address: var string,
-                 flags = {SocketFlag.SafeDisconn}) {.tags: [ReadIOEffect].} =
+                 flags = {SocketFlag.SafeDisconn}) {.
+                 tags: [ReadIOEffect], gcsafe, locks: 0.} =
   ## Blocks until a connection is being made from a client. When a connection
   ## is made sets ``client`` to the client socket and ``address`` to the address
   ## of the connecting client.
@@ -938,8 +939,12 @@ proc connect*(socket: Socket, address: string, port = Port(0), timeout: int,
         doAssert socket.handshake()
   socket.fd.setBlocking(true)
 
-proc isSsl*(socket: Socket): bool = return socket.isSSL
+proc isSsl*(socket: Socket): bool = 
   ## Determines whether ``socket`` is a SSL socket.
+  when defined(ssl):
+    result = socket.isSSL
+  else:
+    result = false
 
 proc getFd*(socket: Socket): SocketHandle = return socket.fd
   ## Returns the socket's file descriptor