2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-22 18:19:42 +00:00

[master] include serial number in JSON zone stats

4068.	[bug]		Serial number was omitted from JSON zone statistics.
			[RT #38604]
This commit is contained in:
Evan Hunt 2015-02-25 16:55:25 -08:00
parent 8378b0c190
commit aeff3f0541
2 changed files with 13 additions and 7 deletions

View File

@ -1,3 +1,6 @@
4068. [bug] Serial number was omitted from JSON zone statistics.
[RT #38604]
4067. [cleanup] Reduce noise from RRL when query logging is 4067. [cleanup] Reduce noise from RRL when query logging is
disabled. [RT #38648] disabled. [RT #38648]

View File

@ -14,8 +14,6 @@
* PERFORMANCE OF THIS SOFTWARE. * PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: statschannel.c,v 1.28.224.1 2011/12/22 07:48:27 marka Exp $ */
/*! \file */ /*! \file */
#include <config.h> #include <config.h>
@ -1437,7 +1435,9 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
} }
static json_object * static json_object *
addzone(char *name, char *class, isc_uint32_t serial) { addzone(char *name, char *class, isc_uint32_t serial,
isc_boolean_t add_serial)
{
json_object *node = json_object_new_object(); json_object *node = json_object_new_object();
if (node == NULL) if (node == NULL)
@ -1445,7 +1445,9 @@ addzone(char *name, char *class, isc_uint32_t serial) {
json_object_object_add(node, "name", json_object_new_string(name)); json_object_object_add(node, "name", json_object_new_string(name));
json_object_object_add(node, "class", json_object_new_string(class)); json_object_object_add(node, "class", json_object_new_string(class));
json_object_object_add(node, "serial", json_object_new_int64(serial)); if (add_serial)
json_object_object_add(node, "serial",
json_object_new_int64(serial));
return (node); return (node);
} }
@ -1479,9 +1481,10 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
class_only = class; class_only = class;
if (dns_zone_getserial2(zone, &serial) != ISC_R_SUCCESS) if (dns_zone_getserial2(zone, &serial) != ISC_R_SUCCESS)
serial = -1; zoneobj = addzone(zone_name_only, class_only, 0, ISC_FALSE);
else
zoneobj = addzone(zone_name_only, class_only, serial, ISC_TRUE);
zoneobj = addzone(zone_name_only, class_only, serial);
if (zoneobj == NULL) if (zoneobj == NULL)
return (ISC_R_NOMEMORY); return (ISC_R_NOMEMORY);
@ -1569,7 +1572,7 @@ generatejson(ns_server_t *server, size_t *msglen,
/* /*
* These statistics are included no matter which URL we use. * These statistics are included no matter which URL we use.
*/ */
obj = json_object_new_string("1.0"); obj = json_object_new_string("1.1");
CHECKMEM(obj); CHECKMEM(obj);
json_object_object_add(bindstats, "json-stats-version", obj); json_object_object_add(bindstats, "json-stats-version", obj);