]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1748. [func] dig now returns the byte count for axfr/ixfr.
authorMark Andrews <marka@isc.org>
Thu, 21 Oct 2004 01:44:24 +0000 (01:44 +0000)
committerMark Andrews <marka@isc.org>
Thu, 21 Oct 2004 01:44:24 +0000 (01:44 +0000)
CHANGES
bin/dig/dig.c
bin/dig/dighost.c
bin/dig/include/dig/dig.h

diff --git a/CHANGES b/CHANGES
index 0bc83d8c50a89efc8395317f7a5383af9ba16a2b..39736ab0be78247f5fe153540a6dbd51f145fea0 100644 (file)
--- 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.
 
index b6afa4fa04717a31954151a3ca47fee6f35e9140..8ed35996e4e8bc6a237873298ddcf58c4990bfd9 100644 (file)
@@ -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 <config.h>
 #include <stdlib.h>
@@ -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);
        }
 }
index 8b3fe084075cb2a900a48cac8af73d09ddf324c9..e8c16b66e845e7768462a47b98835d1148d61d80 100644 (file)
@@ -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.");
index b6b4a3945275f5617d3dc63c8db0deb26892d887..efe0928f5d5edc1551acd0b329efc9b56dd9e457 100644 (file)
@@ -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 {