close sock after sending to client

This commit is contained in:
Christian Ulrich 2020-10-07 00:31:04 +02:00
parent bec4c1b158
commit 87a8c44954
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 0 deletions

View File

@ -64,6 +64,7 @@ proc handleRequest(punchd: Punchd, line: string,
let unixFd = unixSock.getFd.AsyncFD
await unixFd.asyncSendMsg(&"ok|{id}\n", @[fromFd(sock.getFd.AsyncFD)])
sock.close()
except PunchHoleError as e:
await unixSock.send(&"error|{id}|{e.msg}\n")