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:
parent
8378b0c190
commit
aeff3f0541
3
CHANGES
3
CHANGES
@ -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
|
||||
disabled. [RT #38648]
|
||||
|
||||
|
@ -14,8 +14,6 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: statschannel.c,v 1.28.224.1 2011/12/22 07:48:27 marka Exp $ */
|
||||
|
||||
/*! \file */
|
||||
|
||||
#include <config.h>
|
||||
@ -1437,7 +1435,9 @@ wrap_jsonfree(isc_buffer_t *buffer, void *arg) {
|
||||
}
|
||||
|
||||
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();
|
||||
|
||||
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, "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);
|
||||
}
|
||||
|
||||
@ -1479,9 +1481,10 @@ zone_jsonrender(dns_zone_t *zone, void *arg) {
|
||||
class_only = class;
|
||||
|
||||
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)
|
||||
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.
|
||||
*/
|
||||
obj = json_object_new_string("1.0");
|
||||
obj = json_object_new_string("1.1");
|
||||
CHECKMEM(obj);
|
||||
json_object_object_add(bindstats, "json-stats-version", obj);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user