allow accept cancellation (#91)
This commit is contained in:
parent
0ec755738c
commit
f354dfebe9
|
@ -190,7 +190,12 @@ proc accept*(server: HttpServer): Future[HttpRequest]
|
||||||
writer: newAsyncStreamWriter(transp))
|
writer: newAsyncStreamWriter(transp))
|
||||||
|
|
||||||
trace "Got new request", isTls = server.secure
|
trace "Got new request", isTls = server.secure
|
||||||
return await server.parseRequest(stream)
|
try:
|
||||||
|
return await server.parseRequest(stream)
|
||||||
|
except CatchableError as exc:
|
||||||
|
await stream.closeWait()
|
||||||
|
raise exc
|
||||||
|
|
||||||
|
|
||||||
proc create*(
|
proc create*(
|
||||||
_: typedesc[HttpServer],
|
_: typedesc[HttpServer],
|
||||||
|
|
Loading…
Reference in New Issue