Issues with Socket#getaddrinfo
------------------------------

                 Key: JRUBY-2666
                 URL: http://jira.codehaus.org/browse/JRUBY-2666
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
         Environment: Mac OS 10.5
            Reporter: Federico Builes
            Priority: Minor


According to the getaddrinfo man page and to MRI, this function should return a 
INADDR_ANY address (0.0.0.0) if the socket's passive and a loopback address if 
it's not (127.0.0.1) in case host is not passed as an argument (empty string).

Currently JRuby always returns a loopback address:

{noformat}
$ jirb
irb(main):001:0> require 'socket'
=> true
irb(main):002:0> Socket::getaddrinfo("", "http", 
                              Socket::AF_INET, 
                              Socket::SOCK_STREAM, 
                              Socket::IPPROTO_TCP,
                              Socket::AI_PASSIVE)  

=> [["AF_INET", 80, "localhost", "127.0.0.1", 2, 1, 6]]

The expected output would be:

=> [["AF_INET", 80, "0.0.0.0", "0.0.0.0", 2, 1, 6]]

{noformat}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to