Project

General

Profile

Actions

Bug #15067

closed

library/socket/socket/getnameinfo_spec.rb always errors with multiple IP addresses hostname

Added by usa (Usaku NAKAMURA) over 5 years ago. Updated over 4 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:88828]

Description

If the hostname is bind with multiple IP addresses, Socket.getnameinfo raises SocketError.
It's the spec of this method.

irb(main):001:0> require "socket"
=> true
irb(main):002:0> Socket.getnameinfo(['AF_INET', 21, 'multi'])
Traceback (most recent call last):
        3: from C:/opt/ruby/bin/irb.cmd:21:in `<main>'
        2: from (irb):2
        1: from (irb):2:in `getnameinfo'
SocketError (sockaddr resolved to multiple nodename)
irb(main):003:0> exit

So, this code always reports error on such host.

library/socket/socket/getnameinfo_spec.rb:110

      describe 'without custom flags' do
        it 'returns an Array containing the hostname and service name' do
          array = Socket.getnameinfo(@addr)  #<=== problem code
          array.should be_an_instance_of(Array)
          array[0].should include(@hostname)

Updated by jeremyevans0 (Jeremy Evans) over 4 years ago

  • Status changed from Open to Closed

Spec was removed in [ruby-core:88828] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/t..." href="/projects/ruby-master/repository/git/revisions/c4cc4725ec08f26b9f46b99e38b0eba18f733ddc">c4cc4725ec08f26b9f46b99e38b0eba18f733ddc.

Actions

Also available in: Atom PDF

Like0
Like0