openssl.buffering.rb.encoding.patch

Eric Hodel, 12/03/2013 07:14 AM

Download (1.02 KB)

View differences:

ext/openssl/lib/openssl/buffering.rb (working copy)
1
#
1
# coding: binary
2 2
#--
3 3
#= $RCSfile$ -- Buffering mix-in module.
4 4
#
test/openssl/test_ssl.rb (working copy)
30 30
    end
31 31
  end
32 32

  
33
  def test_ssl_gets
34
    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) { |server, port|
35
      server_connect(port) { |ssl|
36
        ssl.write "abc\n"
37
        IO.select [ssl]
38

  
39
        line = ssl.gets
40

  
41
        assert_equal "abc\n", line
42
        assert_equal Encoding::BINARY, line.encoding
43
      }
44
    }
45
  end
46

  
33 47
  def test_ssl_read_nonblock
34 48
    start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true) { |server, port|
35 49
      server_connect(port) { |ssl|