must strip newline from punchd message

This commit is contained in:
Christian Ulrich 2020-07-20 10:08:28 +02:00
parent 3f9cb6a3b1
commit 41048dd8cd
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 2 additions and 1 deletions

View File

@ -75,7 +75,8 @@ proc handlePunchdMessages(connection: PunchdConnection) {.async.} =
while true:
let fd = connection.sock.getFd.AsyncFD
let resp = await fd.asyncRecvMsg(size = 400, cmsgSize = sizeof(AsyncFD))
let args = resp.data.parseArgs(3, 1)
let line = resp.data.strip(leading = false, trailing = true, chars = {'\n'})
let args = line.parseArgs(3, 1)
case args[0]:
of "ok":
let outMsg = connection.outMessages[args[1]]