From: Jelte Jansen Date: Tue, 8 Nov 2005 11:06:29 +0000 (+0000) Subject: rr_frm_str can now also handle question RRs (i.e. without rdata) X-Git-Tag: release-1.1.0~631 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8f2a5e25eea0c6d1b7222b52fda91094ae075d06;p=thirdparty%2Fldns.git rr_frm_str can now also handle question RRs (i.e. without rdata) removed error when parsing zonefiles and a line does not contain an RR --- diff --git a/rr.c b/rr.c index d0d51186..2f965c52 100644 --- a/rr.c +++ b/rr.c @@ -225,6 +225,8 @@ ldns_rr_new_frm_str(const char *str, uint16_t default_ttl, ldns_rdf *origin) } if (ldns_bget_token(rr_buf, rdata, "\0", LDNS_MAX_PACKETLEN) == -1) { + /* apparently we are done, and it's only a question RR + * so do not free and error here LDNS_FREE(owner); LDNS_FREE(ttl); LDNS_FREE(clas); @@ -235,6 +237,7 @@ ldns_rr_new_frm_str(const char *str, uint16_t default_ttl, ldns_rdf *origin) ldns_buffer_free(rr_buf); ldns_rr_free(new); return NULL; + */ } ldns_buffer_new_frm_data( diff --git a/zone.c b/zone.c index b7f351b8..301dba7d 100644 --- a/zone.c +++ b/zone.c @@ -231,6 +231,9 @@ ldns_zone_new_frm_fp_l(FILE *fp, ldns_rdf *origin, uint16_t ttl, ldns_rr_class c my_class = ldns_rr_get_class(rr); } else { + /* hmz if $ORIGIN was read there is no RR either */ + /* we need to add a feedbacking function */ + /* fprintf(stderr, "Error in file, unable to read RR"); if (line_nr) { fprintf(stderr, " at line %d.\n", *line_nr); @@ -241,6 +244,7 @@ ldns_zone_new_frm_fp_l(FILE *fp, ldns_rdf *origin, uint16_t ttl, ldns_rr_class c fprintf(stderr, "Last rr that was parsed:\n"); ldns_rr_print(stderr, last_rr); dprintf("%s", "\n"); + */ } } if (my_origin) {