Async::DNS SourceResolvDNSMessage

class Message

Extensions to the Resolv::DNS::Message class.

Definitions

def merge!(other)

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.

Implementation

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