Richard Pospesel pushed to branch tor-browser-102.6.0esr-12.5-1 at The Tor Project / Applications / Tor Browser
Commits: c20e9ad7 by Pier Angelo Vendrame at 2023-01-10T19:17:03+00:00 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.
- - - - -
1 changed file:
- toolkit/components/tor-launcher/TorProcess.jsm
Changes:
===================================== toolkit/components/tor-launcher/TorProcess.jsm ===================================== @@ -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) {
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c20e9ad7...
tbb-commits@lists.torproject.org