Ticket #1943: fix_session_lookup_error.patch

File fix_session_lookup_error.patch, 1.3 KB (added by Vladimir Berezhnoy, 12 years ago)

Patch for latest master

  • deluge/core/rpcserver.py

    diff --git a/deluge/core/rpcserver.py b/deluge/core/rpcserver.py
    index b9b417e..36d2f35 100644
    a b def get_session_auth_level(self):  
    494494        """
    495495        if not self.listen:
    496496            return AUTH_LEVEL_ADMIN
    497         return self.factory.authorized_sessions[self.get_session_id()][0]
     497        session_id = self.get_session_id()
     498        if session_id > -1:
     499            return self.factory.authorized_sessions[self.get_session_id()][0]
     500        else:
     501            return AUTH_LEVEL_ADMIN
    498502
    499503    def get_rpc_auth_level(self, rpc):
    500504        """
  • deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py

    diff --git a/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py b/deluge/plugins/AutoAdd/deluge/plugins/autoadd/core.py
    index 6d829b4..f6c96d4 100644
    a b def update_watchdir(self, watchdir_id):  
    241241                if watchdir.get(option+'_toggle', True):
    242242                    opts[option] = value
    243243
     244        # Force session ID to -1 so this isn't mistaken for an RPC call
     245        component.get("RPCServer").factory.session_id = -1
     246
    244247        # Check for .magnet files containing multiple magnet links and
    245248        # create a new .magnet file for each of them.
    246249        for filename in os.listdir(watchdir["abspath"]):