* lib/resolv.rb (Resolv::DNS::Requester::ConnectedUDP): disable

reverse lookup.
  (Resolv::DNS::Requester::UnconnectedUDP): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2009-10-09 12:17:38 +00:00
parent 696eec1e4f
commit 2ea82d336d
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Fri Oct 9 21:14:40 2009 Tanaka Akira <akr@fsij.org>
* lib/resolv.rb (Resolv::DNS::Requester::ConnectedUDP): disable
reverse lookup.
(Resolv::DNS::Requester::UnconnectedUDP): ditto.
Fri Oct 9 10:12:13 2009 NARUSE, Yui <naruse@ruby-lang.org>
* lib/irb/context.rb (IRB::Context#initialize):

View File

@ -655,6 +655,7 @@ class Resolv
def initialize
super()
@sock = UDPSocket.new
@sock.do_not_reverse_lookup = true
@sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
DNS.bind_random_port(@sock)
end
@ -701,9 +702,10 @@ class Resolv
@port = port
is_ipv6 = host.index(':')
@sock = UDPSocket.new(is_ipv6 ? Socket::AF_INET6 : Socket::AF_INET)
@sock.do_not_reverse_lookup = true
@sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
DNS.bind_random_port(@sock, is_ipv6)
@sock.connect(host, port)
@sock.fcntl(Fcntl::F_SETFD, Fcntl::FD_CLOEXEC) if defined? Fcntl::F_SETFD
end
def recv_reply