Skip to content

Commit e10b16a

Browse files
committed
adig: Differentiate between internal and server error
Should not output "Got answer" if there was no answer from the server, instead should just output the internal error. Fix By: Gisle Vanem (@gvanem)
1 parent 7963c51 commit e10b16a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/tools/adig.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,13 @@ static void callback(void *arg, int status, int timeouts, unsigned char *abuf,
743743
(void)arg;
744744
(void)timeouts;
745745

746-
printf(";; Got answer:");
746+
/* We got a "Server status" */
747+
if (status >= ARES_SUCCESS && status <= ARES_EREFUSED) {
748+
printf(";; Got answer:");
749+
} else {
750+
printf(";;");
751+
}
752+
747753
if (status != ARES_SUCCESS) {
748754
printf(" %s", ares_strerror(status));
749755
}

0 commit comments

Comments
 (0)