|
|
|
|
@ -179,6 +179,17 @@ static void OutputAnswer(LogDnsLogThread *aft, json_t *djs, DNSTransaction *tx,
|
|
|
|
|
json_object_set_new(js, "rdata", json_string(a));
|
|
|
|
|
} else if (entry->data_len == 0) {
|
|
|
|
|
json_object_set_new(js, "rdata", json_string(""));
|
|
|
|
|
} else if (entry->type == DNS_RECORD_TYPE_TXT) {
|
|
|
|
|
if (entry->data_len != 0) {
|
|
|
|
|
char buffer[256] = "";
|
|
|
|
|
uint16_t copy_len = entry->data_len < (sizeof(buffer) - 1) ?
|
|
|
|
|
entry->data_len : sizeof(buffer) - 1;
|
|
|
|
|
memcpy(buffer, ptr, copy_len);
|
|
|
|
|
buffer[copy_len] = '\0';
|
|
|
|
|
json_object_set_new(js, "rdata", json_string(buffer));
|
|
|
|
|
} else {
|
|
|
|
|
json_object_set_new(js, "rdata", json_string(""));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|