class Resolv::DNS::Message

Private Instance Methods

merge!(other) click to toggle source

Merge the given message with this message. A number of heuristics are applied in order to ensure that the result makes sense. For example, If the current message is not recursive but is being merged with a message that was recursive, this bit is maintained. If either message is authoritive, then the result is also authoritive.

Modifies the current message in place.

# File lib/async/dns/extensions/resolv.rb, line 29
def merge!(other)
        # Authoritive Answer
        @aa = @aa && other.aa

        @question += other.question
        @answer += other.answer
        @authority += other.authority
        @additional += other.additional

        # Recursion Available
        @ra = @ra || other.ra

        # Result Code (Error Code)
        @rcode = other.rcode unless other.rcode == 0

        # Recursion Desired
        @rd = @rd || other.rd
end