[tbb-commits] [tor-launcher/master] Bug 31488: Moat: support a comma-separated list of transports

gk at torproject.org gk at torproject.org
Thu Aug 22 21:24:40 UTC 2019


commit 71ade2c3d4bb53fdd61f5a40fa574bc614db5d6a
Author: Kathy Brade <brade at pearlcrescent.com>
Date:   Thu Aug 22 09:45:38 2019 -0400

    Bug 31488: Moat: support a comma-separated list of transports
    
    Improve our ClientTransportPlugin config parser to recognize
    "meek" and "meek_client" when they appear within a comma-separated
    list of transports.
---
 src/chrome/content/network-settings.js | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/src/chrome/content/network-settings.js b/src/chrome/content/network-settings.js
index a4f2866..8c1db0f 100644
--- a/src/chrome/content/network-settings.js
+++ b/src/chrome/content/network-settings.js
@@ -642,14 +642,26 @@ function onOpenBridgeDBRequestPrompt()
   let meekClientArgs;
   reply.lineArray.forEach(aLine =>
   {
+    // Parse each ClientTransportPlugin line and look for the meek or
+    // meek_lite transport. This code works a lot like the Tor daemon's
+    // parse_transport_line() function.
     let tokens = aLine.split(' ');
-    if ((tokens.length > 2) &&
-        ((tokens[0] == "meek") || (tokens[0] == "meek_lite")) &&
-        (tokens[1] == "exec"))
+    if ((tokens.length > 2) && (tokens[1] == "exec"))
     {
-      meekTransport = tokens[0];
-      meekClientPath = tokens[2];
-      meekClientArgs = tokens.slice(3);
+      let transportArray = tokens[0].split(",").map(aStr => aStr.trim());
+      let transport = transportArray.find(
+                                  aTransport => (aTransport === "meek"));
+      if (!transport)
+      {
+        transport = transportArray.find(
+                                  aTransport => (aTransport === "meek_lite"));
+      }
+      if (transport)
+      {
+        meekTransport = transport;
+        meekClientPath = tokens[2];
+        meekClientArgs = tokens.slice(3);
+      }
     }
   });
 



More information about the tbb-commits mailing list