Skip to content

Commit

Permalink
* ext/socket/socket.c (Init_socket): IPv6 is not supported although
Browse files Browse the repository at this point in the history
  AF_INET6 is defined on MinGW.

* lib/ipaddr.rb (AF_INET6): workaround in the environment which does
  not support IPv6.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
eban committed Dec 14, 2003
1 parent d2e6f55 commit cd4d74e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
Sun Dec 14 18:46:48 2003 WATANABE Hirofumi <[email protected]>

* ext/socket/socket.c (Init_socket): IPv6 is not supported although
AF_INET6 is defined on MinGW.

* lib/ipaddr.rb (AF_INET6): workaround in the environment which does
not support IPv6.

Sat Dec 13 18:55:16 2003 Nobuyoshi Nakada <[email protected]>

* ext/iconv/charset_alias.rb: preserve original order.
Expand Down
4 changes: 2 additions & 2 deletions ext/socket/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2511,10 +2511,10 @@ Init_socket()
sock_define_const("AF_UNSPEC", AF_UNSPEC);
sock_define_const("PF_UNSPEC", PF_UNSPEC);
#endif
#ifdef AF_INET6
#ifdef INET6
sock_define_const("AF_INET6", AF_INET6);
#endif
#ifdef PF_INET6
#ifdef INET6
sock_define_const("PF_INET6", PF_INET6);
#endif

Expand Down
12 changes: 12 additions & 0 deletions lib/ipaddr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@

require 'socket'

unless Socket.const_defined? "AF_INET6"
class Socket
AF_INET6 = Object.new
end
class << IPSocket
alias getaddress_orig getaddress
def getaddress(s)
/^::/ =~ s ? s : getaddress_orig(s)
end
end
end

# IPAddr provides a set of methods to manipulate an IP address. Both
# IPv4 and IPv6 are supported.
class IPAddr
Expand Down

0 comments on commit cd4d74e

Please sign in to comment.