[tor-commits] [stem/master] remove_hidden_service() cound't drop the last hidden service
atagar at torproject.org
atagar at torproject.org
Sat Dec 20 21:41:07 UTC 2014
commit 7e0c12e1ca24a8d39735b0db72051c554b50c2ae
Author: Damian Johnson <atagar at torproject.org>
Date: Mon Dec 15 12:22:20 2014 -0800
remove_hidden_service() cound't drop the last hidden service
When calling remove_hidden_service() to remove our last hidden service we made
a 'SETCONF <nothing>' call, which left our hidden service configured. Calling
RESETCONF instead so we drop it for realz.
---
stem/control.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/stem/control.py b/stem/control.py
index 4d8b170..4d45b8d 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -2214,6 +2214,13 @@ class Controller(BaseController):
impossible or if there's a syntax error in the configuration values
"""
+ # If we're not adding or updating any hidden services then call RESETCONF
+ # so we drop existing values. Otherwise calling SETCONF is a no-op.
+
+ if not conf:
+ self.reset_conf('HiddenServiceDir')
+ return
+
# Convert conf dictionary into a list of ordered config tuples
hidden_service_options = []
More information about the tor-commits
mailing list