From 94bbc987c6af33091539fad2f2bff1aa6903cd37 Mon Sep 17 00:00:00 2001 From: Frank Ploss Date: Mon, 28 Dec 2015 17:39:08 +0100 Subject: [PATCH] Add auto-retry functionality --- extension.js | 13 +++++-------- tor_control_client.js | 38 ++++++++++++++++++++++++++++++++++--- ui/tor_button.js | 2 +- ui/tor_disconnected_menu.js | 6 ------ 4 files changed, 41 insertions(+), 18 deletions(-) diff --git a/extension.js b/extension.js index 64af7b6..73bd2fa 100644 --- a/extension.js +++ b/extension.js @@ -38,19 +38,16 @@ function init(extensionMeta) { } function enable() { - torControlClient = new TorControlClient(TOR_CONTROL_HOST, TOR_CONTROL_PORT); + torControlClient = new TorControlClient(TOR_CONTROL_HOST, TOR_CONTROL_PORT, true); torButton = new TorButton(torControlClient); Main.panel.addToStatusArea(torButton.Name, torButton); torControlClient.openConnection(); } function disable() { - if (torButton !== null) { + if (torControlClient !== null) + torControlClient.destroy(); + + if (torButton !== null) torButton.destroy(); - torButton = null; - } - if (torControlClient !== null) { - torControlClient.closeConnection(); - torControlClient = null; - } } diff --git a/tor_control_client.js b/tor_control_client.js index 4ef5abf..8749732 100644 --- a/tor_control_client.js +++ b/tor_control_client.js @@ -20,6 +20,7 @@ along with gnome-shell-extension-tor. If not, see