mirror of https://github.com/getdnsapi/getdns.git
Add extra check in test_stub_sync for TCP messages
This commit is contained in:
parent
f89acb6e2d
commit
cbfea31081
|
@ -671,7 +671,7 @@ rebuild_ldns_res(struct getdns_context* context) {
|
||||||
* set_ldns_dnssec_allowed_skew(context,
|
* set_ldns_dnssec_allowed_skew(context,
|
||||||
* context->dnssec_allowed_skew);
|
* context->dnssec_allowed_skew);
|
||||||
*/
|
*/
|
||||||
set_ldns_edns_maximum_udp_payload_size(context,
|
set_ldns_edns_maximum_udp_payload_size(context
|
||||||
context->edns_maximum_udp_payload_size);
|
context->edns_maximum_udp_payload_size);
|
||||||
set_ldns_dns_transport(context, context->dns_transport);
|
set_ldns_dns_transport(context, context->dns_transport);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,19 @@ main()
|
||||||
}
|
}
|
||||||
print_response(response);
|
print_response(response);
|
||||||
getdns_dict_destroy(response);
|
getdns_dict_destroy(response);
|
||||||
|
|
||||||
|
/* Now switch to TCP and make sure everything works */
|
||||||
|
getdns_context_set_dns_transport(this_context, GETDNS_TRANSPORT_TCP_ONLY);
|
||||||
|
|
||||||
|
ret = getdns_general_sync(this_context, "www.google.com", GETDNS_RRTYPE_A,
|
||||||
|
NULL, &response);
|
||||||
|
if (ret != GETDNS_RETURN_GOOD || response == NULL) {
|
||||||
|
fprintf(stderr, "General sync over TCP returned error.\n");
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
print_response(response);
|
||||||
|
getdns_dict_destroy(response);
|
||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
getdns_context_destroy(this_context);
|
getdns_context_destroy(this_context);
|
||||||
/* Assuming we get here, leave gracefully */
|
/* Assuming we get here, leave gracefully */
|
||||||
|
|
Loading…
Reference in New Issue