summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMiklos Fazekas <mfazekas@szemafor.com>2016-03-06 17:28:38 +0100
committerMiklos Fazekas <mfazekas@szemafor.com>2016-03-06 21:36:00 +0100
commitb9486cfd5597328d5cae5ee24379449c49d1f98e (patch)
tree14bcd5b80a9433546159d41da8d78230d4ef199b /lib
parentc6014293cee4a3513bd52c9579a262b4ce3fe21d (diff)
downloadnet-ssh-b9486cfd5597328d5cae5ee24379449c49d1f98e.tar.gz
on_open_failed should tell the session to remove the socket from event loop before closing it
Diffstat (limited to 'lib')
-rw-r--r--lib/net/ssh/authentication/session.rb2
-rw-r--r--lib/net/ssh/service/forward.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/net/ssh/authentication/session.rb b/lib/net/ssh/authentication/session.rb
index 5ac2cdc..67a0be9 100644
--- a/lib/net/ssh/authentication/session.rb
+++ b/lib/net/ssh/authentication/session.rb
@@ -69,7 +69,7 @@ module Net; module SSH; module Authentication
attempted << name
debug { "trying #{name}" }
- begin
+ begin
method = Methods.const_get(name.split(/\W+/).map { |p| p.capitalize }.join).new(self, :key_manager => key_manager)
rescue NameError
debug{"Mechanism #{name} was requested, but isn't a known type. Ignoring it."}
diff --git a/lib/net/ssh/service/forward.rb b/lib/net/ssh/service/forward.rb
index b6349c0..541cbb1 100644
--- a/lib/net/ssh/service/forward.rb
+++ b/lib/net/ssh/service/forward.rb
@@ -91,6 +91,7 @@ module Net; module SSH; module Service
channel.on_open_failed do |ch, code, description|
channel.error { "could not establish direct channel: #{description} (#{code})" }
+ session.stop_listening_to(channel[:socket])
channel[:socket].close
end
end
@@ -273,7 +274,6 @@ module Net; module SSH; module Service
ch[:socket].enqueue(data)
end
- # Handles server close on the sending side by Miklós Fazekas
channel.on_eof do |ch|
debug { "eof #{type} on #{type} forwarded channel" }
begin