+4290. [func] The timers returned by the statistics channel
+ (indicating current time, server boot time, and
+ most recent reconfiguration time) are now reported
+ with millisecond accuracy. [RT #40082]
+
4289. [bug] The server could crash due to memory being used
after it was freed if a zone transfer timed out.
[RT #41297]
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output method="html" indent="yes" version="4.0"/>
- <xsl:template match="statistics[@version="3.7"]">
+ <xsl:template match="statistics[@version="3.8"]">
<html>
<head>
<xsl:if test="system-property('xsl:vendor')!='Transformiix'">
"\n"
"<xsl:stylesheet xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" xmlns=\"http://www.w3.org/1999/xhtml\" version=\"1.0\">\n"
" <xsl:output method=\"html\" indent=\"yes\" version=\"4.0\"/>\n"
- " <xsl:template match=\"statistics[@version="3.7"]\">\n"
+ " <xsl:template match=\"statistics[@version="3.8"]\">\n"
" <html>\n"
" <head>\n"
" <xsl:if test=\"system-property('xsl:vendor')!='Transformiix'\">\n"
generatexml(ns_server_t *server, isc_uint32_t flags,
int *buflen, xmlChar **buf)
{
- char boottime[sizeof "yyyy-mm-ddThh:mm:ssZ"];
- char configtime[sizeof "yyyy-mm-ddThh:mm:ssZ"];
- char nowstr[sizeof "yyyy-mm-ddThh:mm:ssZ"];
+ char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
+ char configtime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
+ char nowstr[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
isc_time_t now;
xmlTextWriterPtr writer = NULL;
xmlDocPtr doc = NULL;
isc_result_t result;
isc_time_now(&now);
- isc_time_formatISO8601(&ns_g_boottime, boottime, sizeof boottime);
- isc_time_formatISO8601(&ns_g_configtime, configtime, sizeof configtime);
- isc_time_formatISO8601(&now, nowstr, sizeof nowstr);
+ isc_time_formatISO8601ms(&ns_g_boottime, boottime, sizeof boottime);
+ isc_time_formatISO8601ms(&ns_g_configtime, configtime, sizeof configtime);
+ isc_time_formatISO8601ms(&now, nowstr, sizeof nowstr);
writer = xmlNewTextWriterDoc(&doc, 0);
if (writer == NULL)
ISC_XMLCHAR "type=\"text/xsl\" href=\"/bind9.xsl\""));
TRY0(xmlTextWriterStartElement(writer, ISC_XMLCHAR "statistics"));
TRY0(xmlTextWriterWriteAttribute(writer, ISC_XMLCHAR "version",
- ISC_XMLCHAR "3.7"));
+ ISC_XMLCHAR "3.8"));
/* Set common fields for statistics dump */
dumparg.type = isc_statsformat_xml;
isc_uint64_t tcpinsizestat_values[dns_sizecounter_in_max];
isc_uint64_t tcpoutsizestat_values[dns_sizecounter_out_max];
stats_dumparg_t dumparg;
- char boottime[sizeof "yyyy-mm-ddThh:mm:ssZ"];
- char configtime[sizeof "yyyy-mm-ddThh:mm:ssZ"];
- char nowstr[sizeof "yyyy-mm-ddThh:mm:ssZ"];
+ char boottime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
+ char configtime[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
+ char nowstr[sizeof "yyyy-mm-ddThh:mm:ss.sssZ"];
isc_time_t now;
REQUIRE(msglen != NULL);
json_object_object_add(bindstats, "json-stats-version", obj);
isc_time_now(&now);
- isc_time_formatISO8601(&ns_g_boottime,
+ isc_time_formatISO8601ms(&ns_g_boottime,
boottime, sizeof(boottime));
- isc_time_formatISO8601(&ns_g_configtime,
+ isc_time_formatISO8601ms(&ns_g_configtime,
configtime, sizeof configtime);
- isc_time_formatISO8601(&now, nowstr, sizeof(nowstr));
+ isc_time_formatISO8601ms(&now, nowstr, sizeof(nowstr));
obj = json_object_new_string(boottime);
CHECKMEM(obj);
<section xml:id="relnotes_changes"><info><title>Feature Changes</title></info>
<itemizedlist>
+ <listitem>
+ <para>
+ The timers returned by the statistics channel (indicating current
+ time, server boot time, and most recent reconfiguration time) are
+ now reported with millisecond accuracy. [RT #40082]
+ </para>
+ </listitem>
<listitem>
<para>
Updated the compiled in addresses for H.ROOT-SERVERS.NET.
*
*/
+void
+isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len);
+/*%<
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using the ISO8601 format: "yyyy-mm-ddThh:mm:ss.sssZ"
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ *\li 'len' > 0
+ *\li 'buf' points to an array of at least len chars
+ *
+ */
+
ISC_LANG_ENDDECLS
#endif /* ISC_TIME_H */
#define NS_PER_S 1000000000 /*%< Nanoseconds per second. */
#define NS_PER_US 1000 /*%< Nanoseconds per microsecond. */
+#define NS_PER_MS 1000000 /*%< Nanoseconds per millisecond. */
#define US_PER_S 1000000 /*%< Microseconds per second. */
/*
INSIST(flen < len);
if (flen != 0)
snprintf(buf + flen, len - flen,
- ".%03u", t->nanoseconds / 1000000);
+ ".%03u", t->nanoseconds / NS_PER_MS);
else {
strncpy(buf, "99-Bad-9999 99:99:99.999", len);
buf[len - 1] = 0;
flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%SZ", gmtime(&now));
INSIST(flen < len);
}
+
+void
+isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len) {
+ time_t now;
+ unsigned int flen;
+
+ REQUIRE(len > 0);
+
+ now = (time_t)t->seconds;
+ flen = strftime(buf, len, "%Y-%m-%dT%H:%M:%SZ", gmtime(&now));
+ INSIST(flen < len);
+ if (flen == len - 5) {
+ flen -= 1; /* rewind one character */
+ snprintf(buf + flen, len - flen, ".%03uZ",
+ t->nanoseconds / NS_PER_MS);
+ }
+}
*
*/
+void
+isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len);
+/*%<
+ * Format the time 't' into the buffer 'buf' of length 'len',
+ * using the ISO8601 format: "yyyy-mm-ddThh:mm:ss.sssZ"
+ * If the text does not fit in the buffer, the result is indeterminate,
+ * but is always guaranteed to be null terminated.
+ *
+ * Requires:
+ *\li 'len' > 0
+ *\li 'buf' points to an array of at least len chars
+ *
+ */
+
isc_uint32_t
isc_time_seconds(const isc_time_t *t);
/*%<
isc_time_add
isc_time_compare
isc_time_formatISO8601
+isc_time_formatISO8601ms
isc_time_formathttptimestamp
isc_time_formattimestamp
isc_time_isepoch
char DateBuf[50];
char TimeBuf[50];
-/* strtime() format: "%Y-%m-%dT%H:%M:%SZ" */
+ /* strtime() format: "%Y-%m-%dT%H:%M:%SZ" */
REQUIRE(len > 0);
if (FileTimeToSystemTime(&t->absolute, &st)) {
buf[0] = 0;
}
}
+
+void
+isc_time_formatISO8601ms(const isc_time_t *t, char *buf, unsigned int len) {
+ SYSTEMTIME st;
+ char DateBuf[50];
+ char TimeBuf[50];
+
+ /* strtime() format: "%Y-%m-%dT%H:%M:%S.SSSZ" */
+
+ REQUIRE(len > 0);
+ if (FileTimeToSystemTime(&t->absolute, &st)) {
+ GetDateFormat(LOCALE_NEUTRAL, 0, &st, "yyyy-MM-dd",
+ DateBuf, 50);
+ GetTimeFormat(LOCALE_NEUTRAL,
+ TIME_NOTIMEMARKER | TIME_FORCE24HOURFORMAT,
+ &st, "hh':'mm':'ss", TimeBuf, 50);
+ snprintf(buf, len, "%sT%s.%03uZ", DateBuf, TimeBuf,
+ st.wMilliseconds);
+ } else {
+ buf[0] = 0;
+ }
+}