From 936ba5832d5061760f8893cc8a30b29f6a4dd2dc Mon Sep 17 00:00:00 2001 From: Xabier de Zuazo Date: Sat, 6 Apr 2013 05:04:47 +0200 Subject: [PATCH] added debug output for read/written packet ids --- lib/client.js | 1 + lib/protocol.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lib/client.js b/lib/client.js index a89ba5b..2131496 100644 --- a/lib/client.js +++ b/lib/client.js @@ -79,6 +79,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) + ")"); 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 38459c6..9554586 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -1256,6 +1256,8 @@ function parsePacket(buffer, isServer) { return { error: new Error("Unrecognized packetId: " + packetId + " (0x" + packetId.toString(16) + ")") } + } else { + debug("read packetId " + packetId + " (0x" + packetId.toString(16) + ")"); } var i, fieldInfo, read, readResults; for (i = 0; i < packetInfo.length; ++i) {