Project

General

Profile

Bug #10747 ยป resolv-tcp-fallback-eacces.patch

jeremyevans0 (Jeremy Evans), 07/08/2019 01:54 AM

View differences:

lib/resolv.rb
513 513

  
514 514
    def fetch_resource(name, typeclass)
515 515
      lazy_initialize
516
      requester = make_udp_requester
516
      begin
517
        requester = make_udp_requester
518
      rescue Errno::EACCES
519
        # fall back to TCP
520
      end
517 521
      senders = {}
518 522
      begin
519 523
        @config.resolv(name) {|candidate, tout, nameserver, port|
524
          requester ||= make_tcp_requester(nameserver, port)
520 525
          msg = Message.new
521 526
          msg.rd = 1
522 527
          msg.add_question(candidate, typeclass)
......
549 554
          end
550 555
        }
551 556
      ensure
552
        requester.close
557
        requester.close if requester
553 558
      end
554 559
    end
555 560

  
556
-