Fix session removal code, prevent missing transport param fail
parent
919b96e4cf
commit
8ddd7a4891
|
@ -558,7 +558,11 @@ class ClientCore < Extension
|
|||
# Indicates if the given transport is a valid transport option.
|
||||
#
|
||||
def valid_transport?(transport)
|
||||
if transport
|
||||
VALID_TRANSPORTS.has_key?(transport.downcase)
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -79,7 +79,9 @@ module PacketDispatcher
|
|||
|
||||
def shutdown_passive_dispatcher
|
||||
return if not self.passive_service
|
||||
self.passive_service.remove_resource(self.conn_id + "/")
|
||||
resource = self.conn_id
|
||||
resource += "/" unless resource.end_with?("/")
|
||||
self.passive_service.remove_resource(resource)
|
||||
|
||||
# If there are no more resources registered on the service, stop it entirely
|
||||
if self.passive_service.resources.empty?
|
||||
|
|
|
@ -281,10 +281,6 @@ class Console::CommandDispatcher::Core
|
|||
# Disconnects the session
|
||||
#
|
||||
def cmd_detach(*args)
|
||||
if not client.passive_service
|
||||
print_error("Detach is only possible for non-stream sessions (http/https)")
|
||||
return
|
||||
end
|
||||
client.shutdown_passive_dispatcher
|
||||
shell.stop
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue