[tbb-commits] [Git][tpo/applications/tor-browser][tor-browser-102.6.0esr-12.5-1] fixup! Bug 40933: Add tor-launcher functionality

Richard Pospesel (@richard) git at gitlab.torproject.org
Tue Jan 10 19:18:15 UTC 2023



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/c20e9ad7c04325c67c7259d7bf69a7ff3e160466

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/c20e9ad7c04325c67c7259d7bf69a7ff3e160466
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20230110/b0b4b08d/attachment-0001.htm>


More information about the tbb-commits mailing list