Skip to content
Snippets Groups Projects
Commit c20e9ad7 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.
parent a958edce
No related branches found
No related tags found
1 merge request!501Bug 41549: Correctly handle tor's stdout
......@@ -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 register or to comment