when nothing else, result[canonical_name] is qname

This commit is contained in:
Willem Toorop 2016-06-09 16:12:06 +02:00
parent 49840c9a85
commit e228f526a3
1 changed files with 8 additions and 5 deletions

View File

@ -703,7 +703,6 @@ _getdns_create_reply_dict(getdns_context *context, getdns_network_req *req,
if (getdns_dict_set_int(result, "answer_type", GETDNS_NAMETYPE_DNS))
goto error;
answer = _getdns_rrset_answer(&answer_spc, req->response
, req->response_len);
@ -1136,10 +1135,9 @@ _getdns_create_getdns_response(getdns_dns_req *completed_request)
goto error;
if (!canonical_name) {
if (getdns_dict_get_bindata(
reply, "canonical_name", &canonical_name))
goto error;
if (getdns_dict_set_bindata(
if (!getdns_dict_get_bindata(
reply, "canonical_name", &canonical_name) &&
getdns_dict_set_bindata(
result, "canonical_name", canonical_name))
goto error;
}
@ -1188,6 +1186,11 @@ _getdns_create_getdns_response(getdns_dns_req *completed_request)
goto error;
replies_tree = NULL;
if (!canonical_name &&
_getdns_dict_set_const_bindata(result, "canonical_name",
completed_request->name_len, completed_request->name))
goto error;
if (call_reporting) {
if (_getdns_dict_set_this_list(
result, "call_reporting", call_reporting))