remote_address should be called on @bare_sock.
Because @sock.remote_address fails if @sock is an SSLSocket. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f0dd33d549
commit
fb8628ecda
@ -1362,7 +1362,7 @@ module Net
|
|||||||
raise FTPReplyError, resp
|
raise FTPReplyError, resp
|
||||||
end
|
end
|
||||||
if m = /\((?<d>[!-~])\k<d>\k<d>(?<port>\d+)\k<d>\)/.match(resp)
|
if m = /\((?<d>[!-~])\k<d>\k<d>(?<port>\d+)\k<d>\)/.match(resp)
|
||||||
return @sock.remote_address.ip_address, m["port"].to_i
|
return @bare_sock.remote_address.ip_address, m["port"].to_i
|
||||||
else
|
else
|
||||||
raise FTPProtoError, resp
|
raise FTPProtoError, resp
|
||||||
end
|
end
|
||||||
|
@ -114,7 +114,7 @@ class FTPTest < Test::Unit::TestCase
|
|||||||
sock = OpenStruct.new
|
sock = OpenStruct.new
|
||||||
sock.remote_address = OpenStruct.new
|
sock.remote_address = OpenStruct.new
|
||||||
sock.remote_address.ip_address = "1080:0000:0000:0000:0008:0800:200c:417a"
|
sock.remote_address.ip_address = "1080:0000:0000:0000:0008:0800:200c:417a"
|
||||||
ftp.instance_variable_set(:@sock, sock)
|
ftp.instance_variable_set(:@bare_sock, sock)
|
||||||
host, port = ftp.send(:parse229, "229 Entering Passive Mode (|||3106|)")
|
host, port = ftp.send(:parse229, "229 Entering Passive Mode (|||3106|)")
|
||||||
assert_equal("1080:0000:0000:0000:0008:0800:200c:417a", host)
|
assert_equal("1080:0000:0000:0000:0008:0800:200c:417a", host)
|
||||||
assert_equal(3106, port)
|
assert_equal(3106, port)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user