Stub daemon mode forwards the request header

This commit is contained in:
Willem Toorop 2016-05-23 11:35:50 +02:00
parent 4479d06ebd
commit 584193eb39
1 changed files with 7 additions and 5 deletions

View File

@ -2356,6 +2356,10 @@ getdns_return_t schedule_request(dns_msg *msg)
/* pass through the header and the OPT record */ /* pass through the header and the OPT record */
n = 0; n = 0;
(void) getdns_dict_get_int(msg->query, "/additional/0/do", &n); (void) getdns_dict_get_int(msg->query, "/additional/0/do", &n);
if ((r = getdns_context_get_resolution_type(context, &msg->rt)))
fprintf(stderr, "Could get resolution type from context: %s\n",
getdns_get_errorstr_by_id(r));
if (msg->rt == GETDNS_RESOLUTION_STUB) { if (msg->rt == GETDNS_RESOLUTION_STUB) {
(void)getdns_dict_set_int( (void)getdns_dict_set_int(
extensions, "/add_opt_parameters/do_bit", n); extensions, "/add_opt_parameters/do_bit", n);
@ -2388,7 +2392,9 @@ getdns_return_t schedule_request(dns_msg *msg)
(void)getdns_dict_set_list(extensions, (void)getdns_dict_set_list(extensions,
"/add_opt_parameters/options", list); "/add_opt_parameters/options", list);
#if 0
fprintf(stderr, "query with extensions: %s\n", getdns_pretty_print_dict(extensions));
#endif
if ((r = getdns_dict_get_bindata(msg->query,"/question/qname",&qname))) if ((r = getdns_dict_get_bindata(msg->query,"/question/qname",&qname)))
fprintf(stderr, "Could not get qname from query: %s\n", fprintf(stderr, "Could not get qname from query: %s\n",
getdns_get_errorstr_by_id(r)); getdns_get_errorstr_by_id(r));
@ -2401,10 +2407,6 @@ getdns_return_t schedule_request(dns_msg *msg)
fprintf(stderr, "Could get qtype from query: %s\n", fprintf(stderr, "Could get qtype from query: %s\n",
getdns_get_errorstr_by_id(r)); getdns_get_errorstr_by_id(r));
else if ((r = getdns_context_get_resolution_type(context, &msg->rt)))
fprintf(stderr, "Could get resolution type from context: %s\n",
getdns_get_errorstr_by_id(r));
else if ((r = getdns_general(context, qname_str, qtype, else if ((r = getdns_general(context, qname_str, qtype,
extensions, msg, &msg->transaction_id, request_cb))) extensions, msg, &msg->transaction_id, request_cb)))
fprintf(stderr, "Could not schedule query: %s\n", fprintf(stderr, "Could not schedule query: %s\n",