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

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



Richard Pospesel pushed to branch tor-browser-102.6.0esr-12.0-1 at The Tor Project / Applications / Tor Browser


Commits:
dca7ddb7 by Pier Angelo Vendrame at 2023-01-10T19:18:47+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.


(cherry picked from commit c20e9ad7c04325c67c7259d7bf69a7ff3e160466)
- - - - -


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

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/dca7ddb757f1e6d6e6dbbf4fac6b94b0e7fd03c1
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/a7bd8760/attachment-0001.htm>


More information about the tbb-commits mailing list