ruby-changes:42303
From: naruse <ko1@a...>
Date: Tue, 29 Mar 2016 16:29:26 +0900 (JST)
Subject: [ruby-changes:42303] naruse:r54377 (ruby_2_3): merge revision(s) 53810: [Backport #12044]
naruse 2016-03-29 16:29:20 +0900 (Tue, 29 Mar 2016) New Revision: 54377 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54377 Log: merge revision(s) 53810: [Backport #12044] * net/ftp.rb: add NullSocket#closed? to fix closing not opened connection. [Fix GH-1232] Modified directories: branches/ruby_2_3/ Modified files: branches/ruby_2_3/ChangeLog branches/ruby_2_3/lib/net/ftp.rb branches/ruby_2_3/test/net/ftp/test_ftp.rb branches/ruby_2_3/version.h Index: ruby_2_3/test/net/ftp/test_ftp.rb =================================================================== --- ruby_2_3/test/net/ftp/test_ftp.rb (revision 54376) +++ ruby_2_3/test/net/ftp/test_ftp.rb (revision 54377) @@ -29,6 +29,14 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_3/test/net/ftp/test_ftp.rb#L29 end end + def test_closed_when_not_connected + ftp = Net::FTP.new + assert_equal(true, ftp.closed?) + assert_nothing_raised(Net::FTPConnectionError) do + ftp.close + end + end + def test_connect_fail server = create_ftp_server { |sock| sock.print("421 Service not available, closing control connection.\r\n") Index: ruby_2_3/version.h =================================================================== --- ruby_2_3/version.h (revision 54376) +++ ruby_2_3/version.h (revision 54377) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/version.h#L1 #define RUBY_VERSION "2.3.0" #define RUBY_RELEASE_DATE "2016-03-29" -#define RUBY_PATCHLEVEL 34 +#define RUBY_PATCHLEVEL 35 #define RUBY_RELEASE_YEAR 2016 #define RUBY_RELEASE_MONTH 3 Index: ruby_2_3/lib/net/ftp.rb =================================================================== --- ruby_2_3/lib/net/ftp.rb (revision 54376) +++ ruby_2_3/lib/net/ftp.rb (revision 54377) @@ -1270,6 +1270,10 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_3/lib/net/ftp.rb#L1270 def read_timeout=(sec) end + def closed? + true + end + def close end Index: ruby_2_3/ChangeLog =================================================================== --- ruby_2_3/ChangeLog (revision 54376) +++ ruby_2_3/ChangeLog (revision 54377) @@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_3/ChangeLog#L1 +Tue Mar 29 16:25:27 2016 Anthony Dmitriyev <antstorm@g...> + + * net/ftp.rb: add NullSocket#closed? to fix closing not opened + connection. [Fix GH-1232] + Tue Mar 29 16:12:08 2016 Koichi ITO <koic.ito@g...> * variable.c: Added documentation about order of `Module#constants` Property changes on: ruby_2_3 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r53810 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/