ruby-changes:39316
From: usa <ko1@a...>
Date: Mon, 27 Jul 2015 12:22:33 +0900 (JST)
Subject: [ruby-changes:39316] usa:r51397 (trunk): commit miss
usa 2015-07-27 12:22:28 +0900 (Mon, 27 Jul 2015) New Revision: 51397 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51397 Log: commit miss Modified files: trunk/test/openssl/test_ssl.rb Index: test/openssl/test_ssl.rb =================================================================== --- test/openssl/test_ssl.rb (revision 51396) +++ test/openssl/test_ssl.rb (revision 51397) @@ -607,6 +607,14 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L607 cert end + def socketpair + if defined? UNIXSocket + UNIXSocket.pair + else + Socket.pair(Socket::AF_INET, Socket::SOCK_STREAM, 0) + end + end + def test_servername_cb_sets_context_on_the_socket hostname = 'example.org' @@ -617,7 +625,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L625 ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| ctx3 } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -647,7 +655,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L655 ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| Object.new } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -683,7 +691,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L691 ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| ctx3 } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -712,7 +720,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L720 ctx2.ciphers = "DH" ctx2.servername_cb = lambda { |args| nil } - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) @@ -746,7 +754,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTes https://github.com/ruby/ruby/blob/trunk/test/openssl/test_ssl.rb#L754 ctx2 end - sock1, sock2 = UNIXSocket.pair + sock1, sock2 = socketpair s2 = OpenSSL::SSL::SSLSocket.new(sock2, ctx2) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/