[前][次][番号順一覧][スレッド一覧]

ruby-changes:42256

From: nagachika <ko1@a...>
Date: Tue, 29 Mar 2016 01:06:34 +0900 (JST)
Subject: [ruby-changes:42256] nagachika:r54330 (ruby_2_2): merge revision(s) 53810: [Backport #12044]

nagachika	2016-03-29 01:06:29 +0900 (Tue, 29 Mar 2016)

  New Revision: 54330

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=54330

  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_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/lib/net/ftp.rb
    branches/ruby_2_2/test/net/ftp/test_ftp.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/lib/net/ftp.rb
===================================================================
--- ruby_2_2/lib/net/ftp.rb	(revision 54329)
+++ ruby_2_2/lib/net/ftp.rb	(revision 54330)
@@ -1070,6 +1070,10 @@ module Net https://github.com/ruby/ruby/blob/trunk/ruby_2_2/lib/net/ftp.rb#L1070
       def read_timeout=(sec)
       end
 
+      def closed?
+        true
+      end
+
       def close
       end
 
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 54329)
+++ ruby_2_2/version.h	(revision 54330)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.5"
 #define RUBY_RELEASE_DATE "2016-03-29"
-#define RUBY_PATCHLEVEL 272
+#define RUBY_PATCHLEVEL 273
 
 #define RUBY_RELEASE_YEAR 2016
 #define RUBY_RELEASE_MONTH 3
Index: ruby_2_2/test/net/ftp/test_ftp.rb
===================================================================
--- ruby_2_2/test/net/ftp/test_ftp.rb	(revision 54329)
+++ ruby_2_2/test/net/ftp/test_ftp.rb	(revision 54330)
@@ -23,6 +23,14 @@ class FTPTest < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/net/ftp/test_ftp.rb#L23
     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_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 54329)
+++ ruby_2_2/ChangeLog	(revision 54330)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Tue Mar 29 01:05:28 2016  Anthony Dmitriyev  <antstorm@g...>
+
+	* net/ftp.rb: add NullSocket#closed? to fix closing not opened
+	  connection.  [Fix GH-1232]
+
 Tue Mar 29 01:02:49 2016  Koichi ITO  <koic.ito@g...>
 
 	* variable.c: Added documentation about order of `Module#constants`

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r53810


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]