Skip to content

Commit b146d74

Browse files
committed
Don't hardcode Ruby connection to IPv4
This fixes #393, thanks to @MarkMartinec.
1 parent e33c565 commit b146d74

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/redis/connection/ruby.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,7 @@ class TCPSocket < ::Socket
115115
include SocketMixin
116116

117117
def self.connect(host, port, timeout)
118-
# Limit lookup to IPv4, as Redis doesn't yet do IPv6...
119-
addr = ::Socket.getaddrinfo(host, nil, Socket::AF_INET)
118+
addr = ::Socket.getaddrinfo(host, nil, Socket::AF_UNSPEC)
120119
sock = new(::Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)
121120
sockaddr = ::Socket.pack_sockaddr_in(port, addr[0][3])
122121

0 commit comments

Comments
 (0)