parent
e82a14b273
commit
87f6a9592c
2 changed files with 27 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ proc read*[T](future: FutureStream[T]): owned(Future[(bool, T)]) =
|
||||||
if resFut.finished: return
|
if resFut.finished: return
|
||||||
|
|
||||||
# We don't want this callback called again.
|
# We don't want this callback called again.
|
||||||
future.cb = nil
|
#future.cb = nil
|
||||||
|
|
||||||
# The return value depends on whether the FutureStream has finished.
|
# The return value depends on whether the FutureStream has finished.
|
||||||
var res: (bool, T)
|
var res: (bool, T)
|
||||||
|
|
|
||||||
26
tests/arc/tasyncorc.nim
Normal file
26
tests/arc/tasyncorc.nim
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
discard """
|
||||||
|
output: '''230000'''
|
||||||
|
cmd: '''nim c --gc:orc -d:useMalloc $file'''
|
||||||
|
valgrind: "true"
|
||||||
|
"""
|
||||||
|
|
||||||
|
# bug #14402
|
||||||
|
|
||||||
|
import asynchttpserver, asyncdispatch, httpclient, strutils
|
||||||
|
|
||||||
|
proc cb(req: Request) {.async, gcsafe.} =
|
||||||
|
const html = " ".repeat(230000)
|
||||||
|
await req.respond(Http200, html)
|
||||||
|
|
||||||
|
var server = newAsyncHttpServer()
|
||||||
|
asyncCheck server.serve(Port(8080), cb)
|
||||||
|
|
||||||
|
proc test {.async.} =
|
||||||
|
var
|
||||||
|
client = newAsyncHttpClient()
|
||||||
|
resp = await client.get("http://localhost:8080")
|
||||||
|
|
||||||
|
let x = (await resp.body).len
|
||||||
|
echo x # crash
|
||||||
|
|
||||||
|
waitFor test()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue