Commit 259a2d33 authored by Daniel Salzman's avatar Daniel Salzman

kdig: unify error states

parent 8d826db3
......@@ -665,7 +665,7 @@ static int process_query_packet(const knot_pkt_t *query,
if (reply == NULL) {
ERR("internal error (%s)\n", knot_strerror(KNOT_ENOMEM));
net_close(net);
return 0;
return -1;
}
// Parse reply to the packet structure.
......@@ -673,7 +673,7 @@ static int process_query_packet(const knot_pkt_t *query,
ERR("malformed reply packet from %s\n", net->remote_str);
knot_pkt_free(reply);
net_close(net);
return 0;
return -1;
}
// Compare reply header id.
......@@ -958,7 +958,7 @@ static int process_xfr_packet(const knot_pkt_t *query,
if (reply == NULL) {
ERR("internal error (%s)\n", knot_strerror(KNOT_ENOMEM));
net_close(net);
return 0;
return -1;
}
// Parse reply to the packet structure.
......@@ -966,7 +966,7 @@ static int process_xfr_packet(const knot_pkt_t *query,
ERR("malformed reply packet from %s\n", net->remote_str);
knot_pkt_free(reply);
net_close(net);
return 0;
return -1;
}
// Compare reply header id.
......@@ -974,7 +974,7 @@ static int process_xfr_packet(const knot_pkt_t *query,
ERR("reply ID mismatch from %s\n", net->remote_str);
knot_pkt_free(reply);
net_close(net);
return 0;
return -1;
}
// Print leading transfer information.
......@@ -988,7 +988,7 @@ static int process_xfr_packet(const knot_pkt_t *query,
knot_pkt_ext_rcode_name(reply));
knot_pkt_free(reply);
net_close(net);
return 0;
return -1;
}
// The first message has a special treatment.
......@@ -1008,7 +1008,7 @@ static int process_xfr_packet(const knot_pkt_t *query,
net->remote_str, knot_strerror(ret));
knot_pkt_free(reply);
net_close(net);
return 0;
return -1;
}
}
......@@ -1020,7 +1020,7 @@ static int process_xfr_packet(const knot_pkt_t *query,
net->remote_str);
knot_pkt_free(reply);
net_close(net);
return 0;
return -1;
}
// Check for question sections equality.
......
Markdown is supported
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