abduco

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | LICENSE

commit 160de0ceb74897df0d5823a9b19f1050a4981b8b
parent 3e9a3fdf4d7a6ba309bf8fed2975f6447455f60e
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Wed,  6 Jan 2016 14:55:49 +0100

Print protocol attach flags in debug output

Diffstat:
debug.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/debug.c b/debug.c @@ -26,12 +26,16 @@ static void print_packet(const char *prefix, Packet *pkt) { fprintf(stderr, "%s: %s ", prefix, type); switch (pkt->type) { case MSG_CONTENT: - for (size_t i = 0; i < pkt->len && i < sizeof(pkt->u.msg); i++) - fprintf(stderr, "%c", pkt->u.msg[i]); + fwrite(pkt->u.msg, pkt->len, 1, stderr); break; case MSG_RESIZE: fprintf(stderr, "%dx%d", pkt->u.ws.ws_col, pkt->u.ws.ws_row); break; + case MSG_ATTACH: + fprintf(stderr, "readonly: %d low-priority: %d", + pkt->u.i & CLIENT_READONLY, + pkt->u.i & CLIENT_LOWPRIORITY); + break; default: fprintf(stderr, "len: %zu", pkt->len); break;