diff --git a/CHANGES b/CHANGES index 0bc83d8c50..39736ab0be 100644 --- a/CHANGES +++ b/CHANGES @@ -5,8 +5,8 @@ 1749. [placeholder] rt12866 -1748. [placeholder] rt12838 - +1748. [func] dig now returns the byte count for axfr/ixfr. + 1747. [bug] BIND 8 compatability: named/named-checkconf failed to parse "host-statistics-max" in named.conf. diff --git a/bin/dig/dig.c b/bin/dig/dig.c index b6afa4fa04..8ed35996e4 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.199 2004/09/16 02:12:37 marka Exp $ */ +/* $Id: dig.c,v 1.200 2004/10/21 01:44:23 marka Exp $ */ #include #include @@ -248,10 +248,12 @@ received(int bytes, isc_sockaddr_t *from, dig_query_t *query) { time(&tnow); printf(";; WHEN: %s", ctime(&tnow)); if (query->lookup->doing_xfr) { - printf(";; XFR size: %u records (messages %u)\n", - query->rr_count, query->msg_count); + printf(";; XFR size: %u records (messages %u, " + "bytes %" ISC_PRINT_QUADFORMAT "u)\n", + query->rr_count, query->msg_count, + query->byte_count); } else { - printf(";; MSG SIZE rcvd: %d\n", bytes); + printf(";; MSG SIZE rcvd: %u\n", bytes); } if (key != NULL) { @@ -265,8 +267,11 @@ received(int bytes, isc_sockaddr_t *from, dig_query_t *query) { puts(""); } else if (query->lookup->identify && !short_form) { diff = isc_time_microdiff(&now, &query->time_sent); - printf(";; Received %u bytes from %s(%s) in %d ms\n\n", - bytes, fromtext, query->servname, + printf(";; Received %" ISC_PRINT_QUADFORMAT "u bytes " + "from %s(%s) in %d ms\n\n", + query->lookup->doing_xfr ? + query->byte_count : (isc_uint64_t)bytes, + fromtext, query->servname, (int)diff/1000); } } diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 8b3fe08407..e8c16b66e8 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.270 2004/10/07 02:21:48 marka Exp $ */ +/* $Id: dighost.c,v 1.271 2004/10/21 01:44:23 marka Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -1874,6 +1874,7 @@ setup_lookup(dig_lookup_t *lookup) { query->userarg = serv->userarg; query->rr_count = 0; query->msg_count = 0; + query->byte_count = 0; ISC_LINK_INIT(query, link); ISC_LIST_INIT(query->recvlist); ISC_LIST_INIT(query->lengthlist); @@ -2443,6 +2444,7 @@ check_for_more_data(dig_query_t *query, dns_message_t *msg, */ query->msg_count++; + query->byte_count += sevent->n; result = dns_message_firstname(msg, DNS_SECTION_ANSWER); if (result != ISC_R_SUCCESS) { puts("; Transfer failed."); diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h index b6b4a39452..efe0928f5d 100644 --- a/bin/dig/include/dig/dig.h +++ b/bin/dig/include/dig/dig.h @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.h,v 1.87 2004/10/07 02:21:48 marka Exp $ */ +/* $Id: dig.h,v 1.88 2004/10/21 01:44:24 marka Exp $ */ #ifndef DIG_H #define DIG_H @@ -207,6 +207,7 @@ struct dig_query { ISC_LINK(dig_query_t) link; isc_sockaddr_t sockaddr; isc_time_t time_sent; + isc_uint64_t byte_count; }; struct dig_server {