[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-91.3.0esr-11.0-1] fixup! Bug 27477: Implement about:torconnect captive portal within Tor Browser



commit e15b3cababedf807c2558404e6c13ed953611752
Author: Matthew Finkel <sysrqb@xxxxxxxxxxxxxx>
Date:   Fri Sep 3 03:52:25 2021 +0000

    fixup! Bug 27477: Implement about:torconnect captive portal within Tor Browser
    
    This reverts commit ff3b679987ee9d5515508d94d78ed28166706249.
---
 browser/modules/TorConnect.jsm | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/browser/modules/TorConnect.jsm b/browser/modules/TorConnect.jsm
index e7b8b364db86..ddc14148eb88 100644
--- a/browser/modules/TorConnect.jsm
+++ b/browser/modules/TorConnect.jsm
@@ -167,19 +167,19 @@ const TorConnect = (() => {
             /* Initial is never transitioned to */
             [TorConnectState.Initial, null],
             /* Configuring */
-            [TorConnectState.Configuring, (self, prevState) => {
+            [TorConnectState.Configuring, async (self, prevState) => {
                 // TODO move this to the transition function
                 if (prevState === TorConnectState.Bootstrapping) {
-                    TorProtocolService.torStopBootstrap();
+                    await TorProtocolService.torStopBootstrap();
                 }
             }],
             /* AutoConfiguring */
-            [TorConnectState.AutoConfiguring, (self, prevState) => {
+            [TorConnectState.AutoConfiguring, async (self, prevState) => {
 
             }],
             /* Bootstrapping */
-            [TorConnectState.Bootstrapping, (self, prevState) => {
-                let error = TorProtocolService.connect();
+            [TorConnectState.Bootstrapping, async (self, prevState) => {
+                let error = await TorProtocolService.connect();
                 if (error) {
                     self.onError(error.message, error.details);
                 } else {
@@ -187,12 +187,12 @@ const TorConnect = (() => {
                 }
             }],
             /* Bootstrapped */
-            [TorConnectState.Bootstrapped, (self,prevState) => {
+            [TorConnectState.Bootstrapped, async (self,prevState) => {
                 // notify observers of bootstrap completion
                 Services.obs.notifyObservers(null, TorConnectTopics.BootstrapComplete);
             }],
             /* Error */
-            [TorConnectState.Error, (self, prevState, errorMessage, errorDetails, fatal) => {
+            [TorConnectState.Error, async (self, prevState, errorMessage, errorDetails, fatal) => {
                 self._errorMessage = errorMessage;
                 self._errorDetails = errorDetails;
 
@@ -204,7 +204,7 @@ const TorConnect = (() => {
                 }
             }],
             /* FatalError */
-            [TorConnectState.FatalError, (self, prevState) => {
+            [TorConnectState.FatalError, async (self, prevState) => {
                 Services.obs.notifyObservers(null, TorConnectTopics.FatalError);
             }],
             /* Disabled */
@@ -213,7 +213,7 @@ const TorConnect = (() => {
             }],
         ])),
 
-        _changeState: function(newState, ...args) {
+        _changeState: async function(newState, ...args) {
             const prevState = this._state;
 
             // ensure this is a valid state transition
@@ -228,7 +228,7 @@ const TorConnect = (() => {
             this._state = newState;
 
             // call our transition function and forward any args
-            this._transitionCallbacks.get(newState)(this, prevState, ...args);
+            await this._transitionCallbacks.get(newState)(this, prevState, ...args);
 
             Services.obs.notifyObservers({state: newState}, TorConnectTopics.StateChange);
         },



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits