Fix some uncaught exceptions if the session is not authorized
This commit is contained in:
parent
99e981dbf8
commit
00d078a5ea
|
@ -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]
|
||||||
|
|
Loading…
Reference in New Issue