reverting port 0 behaviour in portspec

a change was made to protspec that allowed port 0
when we explicitly dissallowed port 0. This change caused
other code that depended on this behaviour to break
bug/bundler_fix
David Maloney 2014-06-25 13:07:22 -05:00
parent 3ed7050b67
commit 97d08a081a
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 3 additions and 3 deletions

View File

@ -534,11 +534,11 @@ module Socket
end
if ports.empty? and not remove.empty? then
ports = 0.upto 65535
ports = 1.upto 65535
end
# Sort, and remove dups and invalid ports
ports.sort.uniq.delete_if { |p| p < 0 or p > 65535 or remove.include? p }
ports.sort.uniq.delete_if { |p| p < 1 or p > 65535 or remove.include? p }
end
#
@ -551,7 +551,7 @@ module Socket
lastp = nil
parr.uniq.sort{|a,b| a<=>b}.map{|a| a.to_i}.each do |n|
next if (n < 0 or n > 65535)
next if (n < 1 or n > 65535)
if not lastp
range = [n]
lastp = n