diff --git a/punchd.nim b/punchd.nim index 9f124f8..8c35839 100644 --- a/punchd.nim +++ b/punchd.nim @@ -64,6 +64,8 @@ proc handleRequest(line: string, unixSock: AsyncSocket) {.async.} = proc handleRequests(userSock: AsyncSocket) {.async.} = while true: + if userSock.isClosed: + break let line = await userSock.recvLine(maxLength = 400) if line.len == 0: break