Class: Resolv::DNS::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/async/dns/extensions/resolv.rb

Instance Method Summary collapse

Instance Method Details

#merge!(other) ⇒ Object

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.



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 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