Permalink
Browse files

Use AF_UNSPEC instead of nil for getaddrinfo family. Fixes #98

  • Loading branch information...
1 parent 808dd46 commit 0583a2845a5754c3003df56d9349f7484991f97f @danp danp committed Dec 30, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/excon/socket.rb
View
@@ -21,9 +21,9 @@ def connect
exception = nil
addrinfo = if @proxy
- ::Socket.getaddrinfo(@proxy[:host], @proxy[:port].to_i, nil, ::Socket::Constants::SOCK_STREAM)
+ ::Socket.getaddrinfo(@proxy[:host], @proxy[:port].to_i, ::Socket::Constants::AF_UNSPEC, ::Socket::Constants::SOCK_STREAM)
else
- ::Socket.getaddrinfo(@params[:host], @params[:port].to_i, nil, ::Socket::Constants::SOCK_STREAM)
+ ::Socket.getaddrinfo(@params[:host], @params[:port].to_i, ::Socket::Constants::AF_UNSPEC, ::Socket::Constants::SOCK_STREAM)
end
addrinfo.each do |_, port, _, ip, a_family, s_type|

0 comments on commit 0583a28

Please sign in to comment.