From: Miek Gieben Date: Wed, 8 Mar 2006 14:25:07 +0000 (+0000) Subject: print NULL pkt when sending fails X-Git-Tag: release-1.1.0~314 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5a29cf692bb0a3ec5651f01e54007d4bc98430aa;p=thirdparty%2Fldns.git print NULL pkt when sending fails --- diff --git a/examples/pcat-print.c b/examples/pcat-print.c index 226161df..a40c26e6 100644 --- a/examples/pcat-print.c +++ b/examples/pcat-print.c @@ -16,10 +16,10 @@ void usage(FILE *fp) { fprintf(fp, "pcat-print [-h] FILE\n\n"); - fprintf(fp, "Read the output if pcat-diff and try to convert the\n"); - fprintf(fp, "hex dump back in the DNS packets. Then print those packets\n"); - fprintf(fp, "to standard output or print the error in case the conversion failed \n"); - fprintf(fp, "There are no options, is FILE is not given, standard input is read\n"); + fprintf(fp, "Read the output of pcat-diff and try to convert the\n"); + fprintf(fp, "hex dump back in to DNS packets. Then print those packets\n"); + fprintf(fp, "to standard output or print the error in case the conversion failed.\n"); + fprintf(fp, "There are no options. If FILE is not given, standard input is read.\n"); fprintf(fp, "\nOUTPUT FORMAT:\n"); fprintf(fp, " Each record consists of an index and then three packets.\n"); fprintf(fp, " Each packet is seperated by a line of '='s.\n"); diff --git a/examples/pcat.c b/examples/pcat.c index ae38f802..e64cb827 100644 --- a/examples/pcat.c +++ b/examples/pcat.c @@ -175,6 +175,11 @@ main(int argc, char **argv) } else { /* todo print failure */ fprintf(stderr, "Failure to send packet\n"); + fprintf(stdout, "%zd\n%zd\n", i, ((size_t)h.caplen * 2)); + /* query */ + data2hex(stdout, q, h.caplen); + /* answer, thus empty */ + fprintf(stdout, "0\n\n"); } ldns_buffer_clear(qpkt); i++;