summary refs log tree commit diff stats
path: root/lib/pure/scgi.nim
diff options
context:
space:
mode:
Diffstat (limited to 'lib/pure/scgi.nim')
-rw-r--r--lib/pure/scgi.nim9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/pure/scgi.nim b/lib/pure/scgi.nim
index a6a0faabc..45f837833 100644
--- a/lib/pure/scgi.nim
+++ b/lib/pure/scgi.nim
@@ -26,6 +26,8 @@
 ## **Warning:** The API of this module is unstable, and therefore is subject
 ## to change.
 
+include "system/inclrtl"
+
 import sockets, strutils, os, strtabs, asyncio
 
 type
@@ -82,7 +84,7 @@ type
   
   TAsyncScgiState = object
     handleRequest: proc (client: PAsyncSocket, 
-                         input: string, headers: PStringTable) {.closure.}
+                         input: string, headers: PStringTable) {.closure,gcsafe.}
     asyncServer: PAsyncSocket
     disp: PDispatcher
   PAsyncScgiState* = ref TAsyncScgiState
@@ -150,7 +152,7 @@ proc writeStatusOkTextContent*(c: TSocket, contentType = "text/html") =
          "Content-Type: $1\r\L\r\L" % contentType)
 
 proc run*(handleRequest: proc (client: TSocket, input: string, 
-                               headers: PStringTable): bool {.nimcall.},
+                               headers: PStringTable): bool {.nimcall,gcsafe.},
           port = TPort(4000)) = 
   ## encapsulates the SCGI object and main loop.
   var s: TScgiState
@@ -246,7 +248,8 @@ proc handleAccept(sock: PAsyncSocket, s: PAsyncScgiState) =
   s.disp.register(client)
 
 proc open*(handleRequest: proc (client: PAsyncSocket, 
-                                input: string, headers: PStringTable) {.closure.},
+                                input: string, headers: PStringTable) {.
+                                closure, gcsafe.},
            port = TPort(4000), address = "127.0.0.1",
            reuseAddr = false): PAsyncScgiState =
   ## Creates an ``PAsyncScgiState`` object which serves as a SCGI server.
;rumpf_a@web.de> 2014-12-30 23:20:40 +0100 committer Araq <rumpf_a@web.de> 2014-12-30 23:20:40 +0100 website updates; Source links now work' href='/ahoang/Nim/commit/web/download.txt?h=devel&id=1b56334c4624ddb1c45282a6071354b8ab9282da'>1b56334c4 ^
9ea55bf88 ^
9ea55bf88 ^
dc8d8ebb7 ^
73fbcc1f6 ^
9ea55bf88 ^
dc8d8ebb7 ^

9ea55bf88 ^
9ea55bf88 ^
f380d2548 ^
dc8d8ebb7 ^
9ea55bf88 ^
bc9749310 ^
dc8d8ebb7 ^
9ea55bf88 ^
27f174379 ^
dc8d8ebb7 ^
9ea55bf88 ^
9ea55bf88 ^
dc8d8ebb7 ^
73fbcc1f6 ^
9ea55bf88 ^
6cc443712 ^

7a557013a ^
4db50dcd8 ^

bc9749310 ^




7a557013a ^
9ea55bf88 ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53