summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Churchill <damoc@gmail.com>2009-12-13 21:50:16 +0000
committerDamien Churchill <damoc@gmail.com>2009-12-13 21:50:16 +0000
commit3f69b05deda1aa58c2d7d958a067d603e06f8c21 (patch)
tree0b5a32f85cf51cb67dac547ddce219635523f42c
parentecca68772ee5b8f596e87337fb339306937b312f (diff)
downloaddeluge-3f69b05deda1aa58c2d7d958a067d603e06f8c21.tar.gz
deluge-3f69b05deda1aa58c2d7d958a067d603e06f8c21.tar.bz2
deluge-3f69b05deda1aa58c2d7d958a067d603e06f8c21.zip
disconnect the client if getting information fails
-rw-r--r--deluge/ui/web/json_api.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/deluge/ui/web/json_api.py b/deluge/ui/web/json_api.py
index 5858e1c50..736c8c43b 100644
--- a/deluge/ui/web/json_api.py
+++ b/deluge/ui/web/json_api.py
@@ -668,7 +668,8 @@ class WebApi(JSONComponent):
c.disconnect()
callback(_("Online"), info)
- def on_info_fail(reason):
+ def on_info_fail(reason, c):
+ c.disconnect()
callback(_("Offline"))
if not connected:
@@ -677,7 +678,7 @@ class WebApi(JSONComponent):
d = c.daemon.info()
d.addCallback(on_info, c)
- d.addErrback(on_info_fail)
+ d.addErrback(on_info_fail, c)
def on_connect_failed(reason, host_id):
callback(_("Offline"))