close socket if client has hung up

This commit is contained in:
Christian Ulrich 2020-10-10 11:14:31 +02:00
parent f50dada999
commit 6dff0847b3
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 0 deletions

View File

@ -77,6 +77,7 @@ proc handleRequests(punchd: Punchd, userSock: AsyncSocket) {.async.} =
break break
let line = await userSock.recvLine(maxLength = 400) let line = await userSock.recvLine(maxLength = 400)
if line.len == 0: if line.len == 0:
userSock.close()
break break
asyncCheck punchd.handleRequest(line, userSock) asyncCheck punchd.handleRequest(line, userSock)