Project

General

Profile

Bug #5845 » addrinfo_family_addrinfo_fix.patch

ohai (Ippei Obayashi), 01/05/2012 06:35 PM

View differences:

ext/socket/lib/socket.rb
raise ArgumentError, "no address specified"
elsif Addrinfo === args.first
raise ArgumentError, "too many arguments" if args.length != 1
addrinfo = args.first
raise ArgumentError, "Addrinfo type mismatch" if (self.pfamily != addrinfo.pfamily) || (self.socktype != addrinfo.socktype) || (self.protocol != addrinfo.protocol)
addrinfo
elsif self.ip?
raise ArgumentError, "IP address needs host and port but #{args.length} arguments given" if args.length != 2
host, port = args
(1-1/2)