print sent and received packet contents in debug mode

This commit is contained in:
Xabier de Zuazo 2013-04-15 06:40:09 +02:00
parent a48d6dcdd8
commit 664c7e380a
2 changed files with 2 additions and 0 deletions

View File

@ -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);
};

View File

@ -1282,6 +1282,7 @@ function parsePacket(buffer, isServer) {
results[fieldInfo.name] = readResults.value;
size += readResults.size;
}
debug(results);
return {
size: size,
results: results,