From: Willem Toorop Date: Tue, 18 Nov 2014 12:10:03 +0000 (+0100) Subject: No compression for dname's above pos 16383 X-Git-Tag: release-1.7.0-rc1~126 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27e1f1bcfcd452b7cbc9ad83be98b4d4a2d8fbb6;p=thirdparty%2Fldns.git No compression for dname's above pos 16383 --- diff --git a/host2wire.c b/host2wire.c index 40df9002..06f45bac 100644 --- a/host2wire.c +++ b/host2wire.c @@ -72,13 +72,14 @@ ldns_dname2buffer_wire_compress(ldns_buffer *buffer, const ldns_rdf *name, ldns_ { return LDNS_STATUS_MEM_ERR; } - node->key = strdup((const char *)ldns_rdf_data(name)); - node->data = (void *) (intptr_t) ldns_buffer_position(buffer); - if(!ldns_rbtree_insert(compression_data,node)) - { - /* fprintf(stderr,"Name not found but now it's there?\n"); */ + if (ldns_buffer_position(buffer) < 16384) { + node->key = strdup((const char *)ldns_rdf_data(name)); + node->data = (void *) (intptr_t) ldns_buffer_position(buffer); + if(!ldns_rbtree_insert(compression_data,node)) + { + /* fprintf(stderr,"Name not found but now it's there?\n"); */ + } } - label = ldns_dname_label(name, 0); rest = ldns_dname_left_chop(name); size = ldns_rdf_size(label) - 1; /* Don't want the final zero */