From 3f59b31d517c91afdf06103d3d8e283ee9abf458 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 18 Jul 2013 07:07:25 -0700 Subject: [PATCH] Log received udp messages as b64-encoded strings. These match what the relay's now logging --- xwords4/linux/relaycon.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwords4/linux/relaycon.c b/xwords4/linux/relaycon.c index 430a243a9..9d7afb7a5 100644 --- a/xwords4/linux/relaycon.c +++ b/xwords4/linux/relaycon.c @@ -196,7 +196,11 @@ relaycon_receive( void* closure, int socket ) ssize_t nRead = recvfrom( socket, buf, sizeof(buf), 0, /* flags */ (struct sockaddr*)&from, &fromlen ); - XP_LOGF( "%s: read %d bytes", __func__, nRead ); + + gchar* b64 = g_base64_encode( (const guchar*)buf, + ((0 <= nRead)? nRead : 0) ); + XP_LOGF( "%s: read %d bytes ('%s')", __func__, nRead, b64 ); + g_free( b64 ); if ( 0 <= nRead ) { const XP_U8* ptr = buf; const XP_U8* end = buf + nRead;