Fix some uncaught exceptions if the session is not authorized

This commit is contained in:
Andrew Resch 2009-04-18 18:19:47 +00:00
parent 99e981dbf8
commit 00d078a5ea
1 changed files with 2 additions and 2 deletions

View File

@ -231,7 +231,7 @@ class DelugeRPCProtocol(Protocol):
self.transport.loseConnection() self.transport.loseConnection()
finally: finally:
return return
elif method == "daemon.set_event_interest": elif method == "daemon.set_event_interest" and self.transport.sessionno in self.factory.authorized_sessions:
# This special case is to allow clients to set which events they are # This special case is to allow clients to set which events they are
# interested in receiving. # interested in receiving.
# We are expecting a sequence from the client. # We are expecting a sequence from the client.
@ -246,7 +246,7 @@ class DelugeRPCProtocol(Protocol):
finally: finally:
return return
if method in self.factory.methods: if method in self.factory.methods and self.transport.sessionno in self.factory.authorized_sessions:
try: try:
method_auth_requirement = self.factory.methods[method]._rpcserver_auth_level method_auth_requirement = self.factory.methods[method]._rpcserver_auth_level
auth_level = self.factory.authorized_sessions[self.transport.sessionno] auth_level = self.factory.authorized_sessions[self.transport.sessionno]