Commit 81e6a584 authored by Mark Andrews's avatar Mark Andrews
Browse files

1748. [func] dig now returns the byte count for axfr/ixfr.

parent 05559753
......@@ -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.
......
......@@ -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);
}
}
......
......@@ -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.");
......
......@@ -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 {
......
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