[tor-commits] [tor-browser] branch tor-browser-102.4.0esr-12.0-2 updated: fixup! Bug 40933: Add tor-launcher functionality

gitolite role git at cupani.torproject.org
Tue Nov 8 13:04:40 UTC 2022


This is an automated email from the git hooks/post-receive script.

pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-2
in repository tor-browser.

The following commit(s) were added to refs/heads/tor-browser-102.4.0esr-12.0-2 by this push:
     new ab28234080bc fixup! Bug 40933: Add tor-launcher functionality
ab28234080bc is described below

commit ab28234080bca4bebe36bcbee081fa63c6ccf661
Author: Pier Angelo Vendrame <pierov at torproject.org>
AuthorDate: Tue Nov 8 11:18:14 2022 +0100

    fixup! Bug 40933: Add tor-launcher functionality
    
    Bug 41436: Fixed handling of settings array
    
    They were using a newline as a splitter, rather than repeating the key.
    Also, improved the logging to be more useful.
    
    Finally, linted again and switched from a `new Array` to `[]`.
---
 toolkit/components/tor-launcher/TorProtocolService.jsm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/toolkit/components/tor-launcher/TorProtocolService.jsm b/toolkit/components/tor-launcher/TorProtocolService.jsm
index 3ccffd6883f5..de9c54c71137 100644
--- a/toolkit/components/tor-launcher/TorProtocolService.jsm
+++ b/toolkit/components/tor-launcher/TorProtocolService.jsm
@@ -233,11 +233,14 @@ const TorProtocolService = {
               this._returnConnection();
             } else {
               // Connection is bad.
+              logger.warn(
+                "sendCommand returned an empty response, taking the connection as broken and closing it."
+              );
               this._closeConnection();
             }
           }
         } catch (e) {
-          logger.error("Cannot send a command", e);
+          logger.error(`Cannot send the command ${cmd}`, e);
           this._closeConnection();
         }
       } catch (e) {
@@ -299,7 +302,7 @@ const TorProtocolService = {
         if (valType === "boolean") {
           rv += val ? "1" : "0";
         } else if (Array.isArray(val)) {
-          rv += val.map(TorParsers.escapeString).join("\n");
+          rv += val.map(TorParsers.escapeString).join(` ${key}=`);
         } else if (valType === "string") {
           rv += TorParsers.escapeString(val);
         } else {
@@ -666,7 +669,7 @@ const TorProtocolService = {
     const salt = Array.from(crypto.getRandomValues(new Uint8Array(8)));
 
     // Convert hex-encoded password to an array of bytes.
-    const password = new Array();
+    const password = [];
     for (let i = 0; i < aHexPassword.length; i += 2) {
       password.push(parseInt(aHexPassword.substring(i, i + 2), 16));
     }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list