summaryrefslogtreecommitdiff
path: root/examples/ldns-keyfetcher.c
diff options
context:
space:
mode:
authorJelte Jansen <jeltejan@NLnetLabs.nl>2006-04-06 12:09:27 +0200
committerJelte Jansen <jeltejan@NLnetLabs.nl>2006-04-06 12:09:27 +0200
commitf8d406df7d28e4b9e6a3175922af276a40a74186 (patch)
treec0cfce2df723589df2c8f5e82061c51611276320 /examples/ldns-keyfetcher.c
parentcd6abc683b5001fdc91d2d6babe53c25ae27d4a5 (diff)
downloadldns-f8d406df7d28e4b9e6a3175922af276a40a74186.tar.gz
some error messages
Diffstat (limited to 'examples/ldns-keyfetcher.c')
-rw-r--r--examples/ldns-keyfetcher.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index 114e2d84..70eaa3af 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -87,12 +87,18 @@ retrieve_dnskeys(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
ldns_resolver_set_recursive(res, false);
/* setup the root nameserver in the new resolver */
- if (ldns_resolver_push_nameserver_rr_list(res, dns_root) != LDNS_STATUS_OK) {
+ status = ldns_resolver_push_nameserver_rr_list(res, dns_root);
+ if (status != LDNS_STATUS_OK) {
+ fprintf(stderr, "Error setting root nameservers in resolver: %s\n", ldns_get_errorstr_by_id(status));
return NULL;
}
ldns_pkt_free(p);
status = ldns_resolver_send(&p, res, name, t, c, 0);
+ if (status != LDNS_STATUS_OK) {
+ printf("Error querying root servers: %s\n", ldns_get_errorstr_by_id);
+ return NULL;
+ }
/* from now on, use TCP */
ldns_resolver_set_usevc(res, true);
@@ -100,11 +106,6 @@ retrieve_dnskeys(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
while(status == LDNS_STATUS_OK &&
ldns_pkt_reply_type(p) == LDNS_PACKET_REFERRAL) {
- if (!p) {
- /* some error occurred, bail out */
- return NULL;
- }
-
new_nss_a = ldns_pkt_rr_list_by_type(p,
LDNS_RR_TYPE_A, LDNS_SECTION_ADDITIONAL);
new_nss_aaaa = ldns_pkt_rr_list_by_type(p,