Bug 923600 - don't pretty print RDP packets when devtools.debugger.log is false; r=robcee

This commit is contained in:
Nick Fitzgerald 2013-10-06 11:45:07 -07:00
parent 681cf82bdb
commit 9d1738c70b

View File

@ -7,6 +7,8 @@
"use strict"; "use strict";
Components.utils.import("resource://gre/modules/NetUtil.jsm"); Components.utils.import("resource://gre/modules/NetUtil.jsm");
let wantLogging = Services.prefs.getBoolPref("devtools.debugger.log");
/** /**
* An adapter that handles data transfers between the debugger client and * An adapter that handles data transfers between the debugger client and
* server. It can work with both nsIPipe and nsIServerSocket transports so * server. It can work with both nsIPipe and nsIServerSocket transports so
@ -66,8 +68,9 @@ DebuggerTransport.prototype = {
* they are passed to this method. * they are passed to this method.
*/ */
send: function DT_send(aPacket) { send: function DT_send(aPacket) {
// TODO (bug 709088): remove pretty printing when the protocol is done. let data = wantLogging
let data = JSON.stringify(aPacket, null, 2); ? JSON.stringify(aPacket, null, 2)
: JSON.stringify(aPacket);
data = this._converter.ConvertFromUnicode(data); data = this._converter.ConvertFromUnicode(data);
data = data.length + ':' + data; data = data.length + ':' + data;
this._outgoing += data; this._outgoing += data;