From 664c7e380a0c900032463b5c714cce74d265f904 Mon Sep 17 00:00:00 2001 From: Xabier de Zuazo Date: Mon, 15 Apr 2013 06:40:09 +0200 Subject: [PATCH] print sent and received packet contents in debug mode --- lib/client.js | 1 + lib/protocol.js | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/client.js b/lib/client.js index 5bf0b29..2b32dbb 100644 --- a/lib/client.js +++ b/lib/client.js @@ -91,6 +91,7 @@ Client.prototype.end = function(reason) { Client.prototype.write = function(packetId, params) { var buffer = createPacketBuffer(packetId, params, this.isServer); debug("writing packetId " + packetId + " (0x" + packetId.toString(16) + ")"); + debug(params); var out = this.encryptionEnabled ? new Buffer(this.cipher.update(buffer), 'binary') : buffer; this.socket.write(out); }; diff --git a/lib/protocol.js b/lib/protocol.js index 10e24fc..d7f4ec1 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -1282,6 +1282,7 @@ function parsePacket(buffer, isServer) { results[fieldInfo.name] = readResults.value; size += readResults.size; } + debug(results); return { size: size, results: results,