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

ruby-changes:44766

From: shugo <ko1@a...>
Date: Sat, 19 Nov 2016 13:19:40 +0900 (JST)
Subject: [ruby-changes:44766] shugo:r56839 (trunk): Shut down TLS connections gracefully.

shugo	2016-11-19 13:19:35 +0900 (Sat, 19 Nov 2016)

  New Revision: 56839

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

  Log:
    Shut down TLS connections gracefully.

  Modified files:
    trunk/lib/net/ftp.rb
Index: lib/net/ftp.rb
===================================================================
--- lib/net/ftp.rb	(revision 56838)
+++ lib/net/ftp.rb	(revision 56839)
@@ -1281,7 +1281,7 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/ftp.rb#L1281
     def close
       if @sock and not @sock.closed?
         begin
-          @bare_sock.shutdown(Socket::SHUT_WR) rescue nil
+          @sock.shutdown(Socket::SHUT_WR) rescue nil
           orig, self.read_timeout = self.read_timeout, 3
           @sock.read rescue nil
         ensure
@@ -1404,6 +1404,10 @@ module Net https://github.com/ruby/ruby/blob/trunk/lib/net/ftp.rb#L1404
       end
 
       def shutdown(*args)
+        if @io.respond_to?(:stop)
+          # shut down the TLS connection gracefully.
+          @io.stop
+        end
         @io.to_io.shutdown(*args)
       end
 

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

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