Skip to content
Snippets Groups Projects
Commit dca7ddb7 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern: Committed by Richard Pospesel
Browse files

fixup! Bug 40933: Add tor-launcher functionality

Bug 41549: Correctly handle tor's stdout

Subprocess.jsm manages stdout through a pipe, which we never emptied.
As a result, it tor filled it completely, a lot of other stuff stalled.

The previous implementation dumped tor's stdout to the browser's one,
so this commit restores this behavior.


(cherry picked from commit c20e9ad7)
parent 7774a06e
No related branches found
No related tags found
No related merge requests found
......@@ -133,9 +133,10 @@ class TorProcess {
arguments: this._args,
environment,
environmentAppend: true,
stderr: "pipe",
stderr: "stdout",
};
this._subprocess = await Subprocess.call(options);
this._dumpStdout();
this._watchProcess();
this._status = TorProcessStatus.Running;
this._torProcessStartTime = Date.now();
......@@ -173,6 +174,16 @@ class TorProcess {
this._didConnectToTorControlPort = true;
}
async _dumpStdout() {
let string;
while (
this._subprocess &&
(string = await this._subprocess.stdout.readString())
) {
dump(string);
}
}
async _watchProcess() {
const watched = this._subprocess;
if (!watched) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment