]> git.ipfire.org Git - thirdparty/dnspython.git/commit
Add prefer_truncation to Message.to_wire(). (#1023)
authorBrian Wellington <bwelling@xbill.org>
Wed, 20 Dec 2023 22:09:34 +0000 (14:09 -0800)
committerGitHub <noreply@github.com>
Wed, 20 Dec 2023 22:09:34 +0000 (14:09 -0800)
commit1fa786055af872560b295e6a568169dca6efeabb
tree443b31247b56f8e638b7e306c43678d7ccf2bb7f
parent18fa8c43e92bb5452eab88c3ac72f46c9b795a51
Add prefer_truncation to Message.to_wire(). (#1023)

If a caller passes prefer_truncation=True, the message will be truncated
if it would otherwise exceed the maximum length.  If the truncation
occurs before the additional section, the TC bit will be set.

This behavior matches what a name server would do when generating a
response.
dns/message.py
tests/test_message.py