mirror of
https://github.com/codex-storage/nim-websock.git
synced 2025-01-22 16:39:19 +00:00
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))
|
||||
|
||||
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*(
|
||||
_: typedesc[HttpServer],
|
||||
|
Loading…
x
Reference in New Issue
Block a user