diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-09-17 14:50:04 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-09-17 16:01:52 +0100 |
commit | bb02f0fbe80ef093731bc9a6a407f1edaccf991d (patch) | |
tree | ca2a93fd4e01c830c8c789b61ae104190caecd66 /daemon/proto.c | |
parent | 5ccae24e06c52977f8b71d00c19f1100c1fa9c4c (diff) | |
download | libguestfs-bb02f0fbe80ef093731bc9a6a407f1edaccf991d.tar.gz libguestfs-bb02f0fbe80ef093731bc9a6a407f1edaccf991d.tar.xz libguestfs-bb02f0fbe80ef093731bc9a6a407f1edaccf991d.zip |
Fix verbose packet dumping functions.
Add the configure parameter --enable-packet-dump so that this
code can be enabled without editing the source.
This code is normally commented out, because it is too verbose
unless you happen to be debugging the underlying protocol. Because
it is normally commented out, I found it had bit-rotted slightly.
This commit also fixes the obvious problems.
Diffstat (limited to 'daemon/proto.c')
-rw-r--r-- | daemon/proto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/daemon/proto.c b/daemon/proto.c index 431f219a..d03a048c 100644 --- a/daemon/proto.c +++ b/daemon/proto.c @@ -81,12 +81,12 @@ main_loop (int _sock) xread (sock, buf, len); -#if 0 +#ifdef ENABLE_PACKET_DUMP if (verbose) { - int i, j; + size_t i, j; for (i = 0; i < len; i += 16) { - printf ("%04x: ", i); + printf ("%04zx: ", i); for (j = i; j < MIN (i+16, len); ++j) printf ("%02x ", (unsigned char) buf[j]); for (; j < i+16; ++j) |