Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take the current header truncated bit into account #1384

Merged
merged 3 commits into from Mar 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions crates/proto/src/op/message.rs
Expand Up @@ -560,7 +560,7 @@ impl Message {
pub fn update_counts(&mut self) -> &mut Self {
self.header = update_header_counts(
&self.header,
false,
self.truncated(),
HeaderCounts {
query_count: self.queries.len(),
answer_count: self.answers.len(),
Expand Down Expand Up @@ -797,7 +797,8 @@ where
nameserver_count: nameserver_count.0,
additional_count: additional_count.0,
};
let was_truncated = answer_count.1 || nameserver_count.1 || additional_count.1;
let was_truncated =
header.truncated() || answer_count.1 || nameserver_count.1 || additional_count.1;

place.replace(encoder, update_header_counts(header, was_truncated, counts))?;
Ok(())
Expand Down