diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-14 14:57:11 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-12-14 14:57:11 +0000 |
commit | f73b6e22cc5ef9befda9a5a1fb2bc8d481ec36ac (patch) | |
tree | 8287d71964839c682459db482a27ee4440a44178 /test/net/ftp/test_ftp.rb | |
parent | a646156e11474ef5f473d2bd19d317d469717caa (diff) | |
parent | e1808b522b0f10c5ae45925a7a1ba5aa3067a2f8 (diff) |
add tag v2_3_6
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/tags/v2_3_6@61254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/ftp/test_ftp.rb')
-rw-r--r-- | test/net/ftp/test_ftp.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/net/ftp/test_ftp.rb b/test/net/ftp/test_ftp.rb index ae07a59056..fbb3bf246e 100644 --- a/test/net/ftp/test_ftp.rb +++ b/test/net/ftp/test_ftp.rb @@ -1900,4 +1900,22 @@ EOF end end end + + def process_port_or_eprt(sock, line) + case line + when /\APORT (.*)/ + port_args = $1.split(/,/) + host = port_args[0, 4].join(".") + port = port_args[4, 2].map(&:to_i).inject {|x, y| (x << 8) + y} + sock.print("200 PORT command successful.\r\n") + return host, port + when /\AEPRT \|2\|(.*?)\|(.*?)\|/ + host = $1 + port = $2.to_i + sock.print("200 EPRT command successful.\r\n") + return host, port + else + flunk "PORT or EPRT expected" + end + end end |