1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

merge revision(s) 53810: [Backport #12044]

* net/ftp.rb: add NullSocket#closed? to fix closing not opened
	  connection.  [Fix GH-1232]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2016-03-29 07:29:20 +00:00
parent 11b2773441
commit b2ac0f9c7d
4 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,8 @@
Tue Mar 29 16:25:27 2016 Anthony Dmitriyev <antstorm@gmail.com>
* 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@gmail.com>
* variable.c: Added documentation about order of `Module#constants`

View file

@ -1270,6 +1270,10 @@ module Net
def read_timeout=(sec)
end
def closed?
true
end
def close
end

View file

@ -29,6 +29,14 @@ class FTPTest < Test::Unit::TestCase
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")

View file

@ -1,6 +1,6 @@
#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