userSock may be closed in handleRequest, so check before recvLine
This commit is contained in:
parent
7c010f9303
commit
5d08473d86
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue