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

[tor-commits] [stem/master] Make `Controller.set_hidden_service_conf` asynchronous



commit 58b9817f8fbc6ae936dad7d2b106943533cd8b4a
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date:   Mon Apr 20 22:19:03 2020 +0300

    Make `Controller.set_hidden_service_conf` asynchronous
---
 stem/control.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index 443a16db..67fb6a47 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -2567,7 +2567,7 @@ class Controller(BaseController):
     self._set_cache({'hidden_service_conf': service_dir_map})
     return service_dir_map
 
-  def set_hidden_service_conf(self, conf: Mapping[str, Any]) -> None:
+  async def set_hidden_service_conf(self, conf: Mapping[str, Any]) -> None:
     """
     Update all the configured hidden services from a dictionary having
     the same format as
@@ -2605,7 +2605,7 @@ class Controller(BaseController):
     # so we drop existing values. Otherwise calling SETCONF is a no-op.
 
     if not conf:
-      self.reset_conf('HiddenServiceDir')
+      await self.reset_conf('HiddenServiceDir')
       return
 
     # Convert conf dictionary into a list of ordered config tuples
@@ -2630,7 +2630,7 @@ class Controller(BaseController):
         else:
           hidden_service_options.append((k, str(v)))
 
-    self.set_options(hidden_service_options)
+    await self.set_options(hidden_service_options)
 
   def create_hidden_service(self, path: str, port: int, target_address: Optional[str] = None, target_port: Optional[int] = None, auth_type: Optional[str] = None, client_names: Optional[Sequence[str]] = None) -> 'stem.control.CreateHiddenServiceOutput':
     """



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