Skip to content

How to split the update in compressed wire format into less than 64K pieces? #744

Answered by rthalley
tonusoo asked this question in Q&A
Discussion options

You must be logged in to vote

If you knew a max size bound for your updates, the easiest thing would be to just assume every update added the max bound and then stop before you got to 64K, but if your updates are not easily bounded, that won't work.

If the message hitting 64K is rare, then splitting (perhaps repeatedly) your dns_update list until you got N right-size messages would work, but you don't want to be sending things multiple times, so you'd need to call message.to_wire() yourself to check the sizes, and then you could save the generated wire format on a list, and once you got a complete list, send them all with multiple calls to dns.query.send_tcp(), which can take a wire format message.

The most efficient …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tonusoo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants