1 | commit dd1c179625acbe83dede29bfef4b7a8eb39f5c40 |
---|
2 | Author: Jens Maier <jens@elberet.de> |
---|
3 | Date: Tue Sep 27 18:39:03 2011 +0200 |
---|
4 | |
---|
5 | fix session lookup error |
---|
6 | |
---|
7 | diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py |
---|
8 | index b9b417e..36d2f35 100644 |
---|
9 | --- a/deluge/core/rpcserver.py |
---|
10 | +++ b/deluge/core/rpcserver.py |
---|
11 | @@ -494,7 +494,11 @@ def get_session_auth_level(self): |
---|
12 | """ |
---|
13 | if not self.listen: |
---|
14 | return AUTH_LEVEL_ADMIN |
---|
15 | - return self.factory.authorized_sessions[self.get_session_id()][0] |
---|
16 | + session_id = self.get_session_id() |
---|
17 | + if session_id > -1: |
---|
18 | + return self.factory.authorized_sessions[self.get_session_id()][0] |
---|
19 | + else: |
---|
20 | + return AUTH_LEVEL_ADMIN |
---|
21 | |
---|
22 | def get_rpc_auth_level(self, rpc): |
---|
23 | """ |
---|
24 | diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py |
---|
25 | index a8405b4..6d2ccff 100644 |
---|
26 | --- a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py |
---|
27 | +++ b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py |
---|
28 | @@ -205,6 +205,8 @@ def update_watchdir(self, watchdir_id): |
---|
29 | if OPTIONS_AVAILABLE.get(option): |
---|
30 | if watchdir.get(option+'_toggle', True): |
---|
31 | opts[option] = value |
---|
32 | + # Force session ID to -1 so this isn't mistaken for an RPC call |
---|
33 | + component.get("RPCServer").factory.session_id = -1 |
---|
34 | for filename in os.listdir(watchdir["abspath"]): |
---|
35 | try: |
---|
36 | filepath = os.path.join(watchdir["abspath"], filename) |
---|