From 41048dd8cdb5604bf501ecd5a8798e112a817133 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Mon, 20 Jul 2020 10:08:28 +0200 Subject: [PATCH] must strip newline from punchd message --- examples/app/app.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/app/app.nim b/examples/app/app.nim index e11dc52..d7d6e46 100644 --- a/examples/app/app.nim +++ b/examples/app/app.nim @@ -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]]