Fixup compression, and test for byteformat compression results.

git-svn-id: file:///svn/unbound/trunk@676 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
Wouter Wijngaards
2007-10-15 14:19:17 +00:00
parent bef17e9e7c
commit aecdb781fc
5 changed files with 20 additions and 4 deletions
+3 -3
View File
@@ -573,13 +573,13 @@ insert_section(struct reply_info* rep, size_t num_rrsets, uint16_t* num_rrs,
/** store query section in wireformat buffer, return RETVAL */
static int
insert_query(struct query_info* qinfo, struct compress_tree_node* tree,
insert_query(struct query_info* qinfo, struct compress_tree_node** tree,
ldns_buffer* buffer, struct region* region)
{
if(ldns_buffer_remaining(buffer) <
qinfo->qname_len+sizeof(uint16_t)*2)
return RETVAL_TRUNC; /* buffer too small */
if(!compress_tree_store(&tree, qinfo->qname,
if(!compress_tree_store(tree, qinfo->qname,
dname_count_labels(qinfo->qname),
ldns_buffer_position(buffer), region, NULL))
return RETVAL_OUTMEM;
@@ -612,7 +612,7 @@ reply_info_encode(struct query_info* qinfo, struct reply_info* rep,
/* insert query section */
if(rep->qdcount) {
if((r=insert_query(qinfo, tree, buffer, region)) !=
if((r=insert_query(qinfo, &tree, buffer, region)) !=
RETVAL_OK) {
if(r == RETVAL_TRUNC) {
/* create truncated message */