Commit 551f1e02 authored by Witold Krecicki's avatar Witold Krecicki
Browse files

4478. [func] Add +continue option to mdig, allow continue on socket errors. [RT #43281]

parent 5aaf7e3a
4478. [func] Add +continue option to mdig, allow continue on socket errors. [RT #43281]
4477. [test] Fix mkeys test timing issues. [RT #41028]
4476. [test] Fix reclimit test on slower machines. [RT #43283]
......
......@@ -101,6 +101,7 @@ static isc_boolean_t display_answer = ISC_TRUE;
static isc_boolean_t display_authority = ISC_TRUE;
static isc_boolean_t display_additional = ISC_TRUE;
static isc_boolean_t display_unknown_format = ISC_FALSE;
static isc_boolean_t continue_on_error = ISC_FALSE;
static isc_uint32_t display_splitwidth = 0xffffffff;
static isc_sockaddr_t srcaddr;
static char *server;
......@@ -205,7 +206,7 @@ static void
recvresponse(isc_task_t *task, isc_event_t *event) {
dns_requestevent_t *reqev = (dns_requestevent_t *)event;
isc_result_t result;
dns_message_t *query, *response;
dns_message_t *query = NULL, *response = NULL;
unsigned int parseflags = 0;
isc_buffer_t *buf = NULL;
unsigned int len = OUTPUTBUF;
......@@ -216,16 +217,17 @@ recvresponse(isc_task_t *task, isc_event_t *event) {
UNUSED(task);
REQUIRE(reqev != NULL);
query = reqev->ev_arg;
if (reqev->result != ISC_R_SUCCESS) {
fprintf(stderr, "response failed with %s\n",
isc_result_totext(reqev->result));
exit(-1);
if (continue_on_error)
goto cleanup;
else
exit(-1);
}
query = reqev->ev_arg;
response = NULL;
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &response);
CHECK("dns_message_create", result);
......@@ -468,8 +470,10 @@ cleanup:
fflush(stdout);
if (style != NULL)
dns_master_styledestroy(&style, mctx);
dns_message_destroy(&query);
dns_message_destroy(&response);
if (query != NULL)
dns_message_destroy(&query);
if (response != NULL)
dns_message_destroy(&response);
dns_request_destroy(&reqev->request);
isc_event_free(&event);
......@@ -1162,6 +1166,11 @@ plus_option(char *option, struct query *query, isc_boolean_t global)
GLOBAL();
display_comments = state;
break;
case 'n':
FULLCHECK("continue");
GLOBAL();
continue_on_error = state;
break;
case 'o':
FULLCHECK("cookie");
if (state && query->edns == -1)
......
......@@ -246,6 +246,15 @@
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]continue</option></term>
<listitem>
<para>
Continue on errors (e.g. timeouts).
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]crypto</option></term>
<listitem>
......
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