Skip to content
Snippets Groups Projects
Commit 5694b39b authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

Do not store names that are already fully covered in compr.tbl.

This prevents storing compression pointers in compression table
which is useless anyway.

fixes #2475

Change-Id: I98542b687f885fa306bff78c54544be00444d8b5
parent 30ad0d05
Branches
Tags
No related merge requests found
......@@ -140,8 +140,9 @@ int knot_response_compress_dname(const knot_dname_t *dname, knot_compr_t *compr,
written += 1;
}
/* Do not insert if exceeds bounds. */
if (compr->wire_pos > KNOT_WIRE_PTR_MAX)
/* Do not insert if exceeds bounds or full match. */
if (match.lbcount == dname->label_count ||
compr->wire_pos > KNOT_WIRE_PTR_MAX)
return written;
/* If table is full, elect name from the lower 1/4 of the table
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment