|
|
@ -166,8 +166,11 @@ const TorControlClient = new Lang.Class({
|
|
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
let line = this._readLine();
|
|
|
|
let line = this._readLine();
|
|
|
|
var reply = this._parseLine(line);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (line === null)
|
|
|
|
|
|
|
|
return {replyLines: ['Lost connection to Tor server']};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var reply = this._parseLine(line);
|
|
|
|
statusCode = reply.statusCode;
|
|
|
|
statusCode = reply.statusCode;
|
|
|
|
replyLines.push(reply.replyLine);
|
|
|
|
replyLines.push(reply.replyLine);
|
|
|
|
} while (reply.isMidReplyLine);
|
|
|
|
} while (reply.isMidReplyLine);
|
|
|
@ -180,7 +183,8 @@ const TorControlClient = new Lang.Class({
|
|
|
|
|
|
|
|
|
|
|
|
_readLine: function() {
|
|
|
|
_readLine: function() {
|
|
|
|
[line, length] = this._inputStream.read_line(null, null);
|
|
|
|
[line, length] = this._inputStream.read_line(null, null);
|
|
|
|
return line.toString().trim();
|
|
|
|
|
|
|
|
|
|
|
|
return (line !== null) ? line.toString().trim() : null;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
_parseLine: function(line) {
|
|
|
|
_parseLine: function(line) {
|
|
|
|