Skip to content
Snippets Groups Projects
Commit 64dcadba authored by Marek Vavrusa's avatar Marek Vavrusa
Browse files

knotc flush was broken without parameters, added an empty RR

fixes #2450, refs #2476

Change-Id: I5437f5cdf25a67a457fddc4582e17a99f25fe6f6
parent 566d1157
No related branches found
No related tags found
No related merge requests found
......@@ -217,19 +217,23 @@ static int cmd_remote(const char *cmd, uint16_t rrt, int argc, char *argv[])
}
/* Build query data. */
knot_rrset_t *rr = remote_build_rr("data.", rrt);
for (int i = 0; i < argc; ++i) {
switch(rrt) {
case KNOT_RRTYPE_NS:
remote_create_ns(rr, argv[i]);
break;
case KNOT_RRTYPE_TXT:
default:
remote_create_txt(rr, argv[i], strlen(argv[i]));
break;
knot_rrset_t *rr = NULL;
if (argc > 0) {
rr = remote_build_rr("data.", rrt);
for (int i = 0; i < argc; ++i) {
switch(rrt) {
case KNOT_RRTYPE_NS:
remote_create_ns(rr, argv[i]);
break;
case KNOT_RRTYPE_TXT:
default:
remote_create_txt(rr, argv[i], strlen(argv[i]));
break;
}
}
remote_query_append(qr, rr);
}
remote_query_append(qr, rr);
if (knot_packet_to_wire(qr, &buf, &buflen) != KNOT_EOK) {
knot_rrset_deep_free(&rr, 1, 1);
knot_packet_free(&qr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment