Fix session removal code, prevent missing transport param fail

bug/bundler_fix
OJ 2015-04-30 22:39:48 +10:00
parent 919b96e4cf
commit 8ddd7a4891
3 changed files with 8 additions and 6 deletions

View File

@ -558,7 +558,11 @@ class ClientCore < Extension
# Indicates if the given transport is a valid transport option.
#
def valid_transport?(transport)
VALID_TRANSPORTS.has_key?(transport.downcase)
if transport
VALID_TRANSPORTS.has_key?(transport.downcase)
else
false
end
end
private

View File

@ -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?

View File

@ -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