mirror of https://github.com/getdnsapi/getdns.git
Update the name of the new option to 'round_robin_upstreams'
This commit is contained in:
parent
6734a00d59
commit
1d4e3dd790
|
@ -73,7 +73,7 @@ static struct const_info consts_info[] = {
|
|||
{ 619, "GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE", GETDNS_CONTEXT_CODE_EDNS_CLIENT_SUBNET_PRIVATE_TEXT },
|
||||
{ 620, "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE_TEXT },
|
||||
{ 621, "GETDNS_CONTEXT_CODE_PUBKEY_PINSET", GETDNS_CONTEXT_CODE_PUBKEY_PINSET_TEXT },
|
||||
{ 622, "GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS", GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS_TEXT },
|
||||
{ 622, "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS_TEXT },
|
||||
{ 700, "GETDNS_CALLBACK_COMPLETE", GETDNS_CALLBACK_COMPLETE_TEXT },
|
||||
{ 701, "GETDNS_CALLBACK_CANCEL", GETDNS_CALLBACK_CANCEL_TEXT },
|
||||
{ 702, "GETDNS_CALLBACK_TIMEOUT", GETDNS_CALLBACK_TIMEOUT_TEXT },
|
||||
|
@ -158,11 +158,11 @@ static struct const_name_info consts_name_info[] = {
|
|||
{ "GETDNS_CONTEXT_CODE_NAMESPACES", 600 },
|
||||
{ "GETDNS_CONTEXT_CODE_PUBKEY_PINSET", 621 },
|
||||
{ "GETDNS_CONTEXT_CODE_RESOLUTION_TYPE", 601 },
|
||||
{ "GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS", 622 },
|
||||
{ "GETDNS_CONTEXT_CODE_SUFFIX", 608 },
|
||||
{ "GETDNS_CONTEXT_CODE_TIMEOUT", 616 },
|
||||
{ "GETDNS_CONTEXT_CODE_TLS_AUTHENTICATION", 618 },
|
||||
{ "GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE", 620 },
|
||||
{ "GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS", 622 },
|
||||
{ "GETDNS_CONTEXT_CODE_UPSTREAM_RECURSIVE_SERVERS", 603 },
|
||||
{ "GETDNS_DNSSEC_BOGUS", 401 },
|
||||
{ "GETDNS_DNSSEC_INDETERMINATE", 402 },
|
||||
|
|
|
@ -1429,7 +1429,7 @@ getdns_context_create_with_extended_memory_functions(
|
|||
goto error;
|
||||
result->tls_auth = GETDNS_AUTHENTICATION_NONE;
|
||||
result->tls_auth_min = GETDNS_AUTHENTICATION_NONE;
|
||||
result->tls_use_all_upstreams = 0;
|
||||
result->round_robin_upstreams = 0;
|
||||
result->limit_outstanding_queries = 0;
|
||||
|
||||
/* unbound context is initialized here */
|
||||
|
@ -2034,11 +2034,11 @@ getdns_context_set_tls_authentication(getdns_context *context,
|
|||
} /* getdns_context_set_tls_authentication_list */
|
||||
|
||||
/*
|
||||
* getdns_context_set_tls_use_all_upstreams
|
||||
* getdns_context_set_round_robin_upstreams
|
||||
*
|
||||
*/
|
||||
getdns_return_t
|
||||
getdns_context_set_tls_use_all_upstreams(getdns_context *context, uint8_t value)
|
||||
getdns_context_set_round_robin_upstreams(getdns_context *context, uint8_t value)
|
||||
{
|
||||
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
|
||||
/* only allow 0 or 1 */
|
||||
|
@ -2046,12 +2046,12 @@ getdns_context_set_tls_use_all_upstreams(getdns_context *context, uint8_t value)
|
|||
return GETDNS_RETURN_CONTEXT_UPDATE_FAIL;
|
||||
}
|
||||
|
||||
context->tls_use_all_upstreams = value;
|
||||
context->round_robin_upstreams = value;
|
||||
|
||||
dispatch_updated(context, GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS);
|
||||
dispatch_updated(context, GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS);
|
||||
|
||||
return GETDNS_RETURN_GOOD;
|
||||
} /* getdns_context_set_tls_use_all_upstreams */
|
||||
} /* getdns_context_set_round_robin_upstreams */
|
||||
|
||||
|
||||
#ifdef HAVE_LIBUNBOUND
|
||||
|
@ -3491,8 +3491,8 @@ _get_context_settings(getdns_context* context)
|
|||
context->append_name)
|
||||
|| getdns_dict_set_int(result, "tls_authentication",
|
||||
context->tls_auth)
|
||||
|| getdns_dict_set_int(result, "tls_use_all_upstreams",
|
||||
context->tls_use_all_upstreams))
|
||||
|| getdns_dict_set_int(result, "round_robin_upstreams",
|
||||
context->round_robin_upstreams))
|
||||
goto error;
|
||||
|
||||
/* list fields */
|
||||
|
@ -3789,11 +3789,11 @@ getdns_context_get_tls_authentication(getdns_context *context,
|
|||
}
|
||||
|
||||
getdns_return_t
|
||||
getdns_context_get_tls_use_all_upstreams(getdns_context *context,
|
||||
getdns_context_get_round_robin_upstreams(getdns_context *context,
|
||||
uint8_t* value) {
|
||||
RETURN_IF_NULL(context, GETDNS_RETURN_INVALID_PARAMETER);
|
||||
RETURN_IF_NULL(value, GETDNS_RETURN_INVALID_PARAMETER);
|
||||
*value = context->tls_use_all_upstreams;
|
||||
*value = context->round_robin_upstreams;
|
||||
return GETDNS_RETURN_GOOD;
|
||||
}
|
||||
|
||||
|
@ -4192,7 +4192,7 @@ _getdns_context_config_setting(getdns_context *context,
|
|||
|
||||
CONTEXT_SETTING_INT(edns_client_subnet_private)
|
||||
CONTEXT_SETTING_INT(tls_authentication)
|
||||
CONTEXT_SETTING_INT(tls_use_all_upstreams)
|
||||
CONTEXT_SETTING_INT(round_robin_upstreams)
|
||||
CONTEXT_SETTING_INT(tls_query_padding_blocksize)
|
||||
|
||||
/**************************************/
|
||||
|
|
|
@ -249,7 +249,7 @@ struct getdns_context {
|
|||
uint32_t dnssec_allowed_skew;
|
||||
getdns_tls_authentication_t tls_auth; /* What user requested for TLS*/
|
||||
getdns_tls_authentication_t tls_auth_min; /* Derived minimum auth allowed*/
|
||||
uint8_t tls_use_all_upstreams;
|
||||
uint8_t round_robin_upstreams;
|
||||
|
||||
getdns_transport_list_t *dns_transports;
|
||||
size_t dns_transport_count;
|
||||
|
|
|
@ -76,8 +76,8 @@ extern "C" {
|
|||
#define GETDNS_CONTEXT_CODE_TLS_QUERY_PADDING_BLOCKSIZE_TEXT "Change related to getdns_context_set_tls_query_padding_blocksize"
|
||||
#define GETDNS_CONTEXT_CODE_PUBKEY_PINSET 621
|
||||
#define GETDNS_CONTEXT_CODE_PUBKEY_PINSET_TEXT "Change related to getdns_context_set_pubkey_pinset"
|
||||
#define GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS 622
|
||||
#define GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS_TEXT "Change related to getdns_context_set_pubkey_pinset"
|
||||
#define GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS 622
|
||||
#define GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS_TEXT "Change related to getdns_context_set_pubkey_pinset"
|
||||
/** @}
|
||||
*/
|
||||
|
||||
|
@ -268,7 +268,7 @@ getdns_context_set_tls_authentication(
|
|||
getdns_context *context, getdns_tls_authentication_t value);
|
||||
|
||||
getdns_return_t
|
||||
getdns_context_set_tls_use_all_upstreams(getdns_context *context, uint8_t value);
|
||||
getdns_context_set_round_robin_upstreams(getdns_context *context, uint8_t value);
|
||||
|
||||
getdns_return_t
|
||||
getdns_context_set_edns_client_subnet_private(getdns_context *context, uint8_t value);
|
||||
|
@ -362,7 +362,7 @@ getdns_context_get_tls_authentication(getdns_context *context,
|
|||
getdns_tls_authentication_t* value);
|
||||
|
||||
getdns_return_t
|
||||
getdns_context_get_tls_use_all_upstreams(getdns_context *context,
|
||||
getdns_context_get_round_robin_upstreams(getdns_context *context,
|
||||
uint8_t* value);
|
||||
|
||||
/**
|
||||
|
|
|
@ -30,7 +30,7 @@ getdns_context_get_suffix
|
|||
getdns_context_get_timeout
|
||||
getdns_context_get_tls_authentication
|
||||
getdns_context_get_tls_query_padding_blocksize
|
||||
getdns_context_get_tls_use_all_upstreams
|
||||
getdns_context_get_round_robin_upstreams
|
||||
getdns_context_get_update_callback
|
||||
getdns_context_get_upstream_recursive_servers
|
||||
getdns_context_process_async
|
||||
|
@ -61,7 +61,7 @@ getdns_context_set_suffix
|
|||
getdns_context_set_timeout
|
||||
getdns_context_set_tls_authentication
|
||||
getdns_context_set_tls_query_padding_blocksize
|
||||
getdns_context_set_tls_use_all_upstreams
|
||||
getdns_context_set_round_robin_upstreams
|
||||
getdns_context_set_update_callback
|
||||
getdns_context_set_upstream_recursive_servers
|
||||
getdns_context_set_use_threads
|
||||
|
|
|
@ -1707,7 +1707,7 @@ upstream_valid(getdns_upstream *upstream,
|
|||
getdns_transport_list_t transport,
|
||||
getdns_network_req *netreq)
|
||||
{
|
||||
if (upstream->transport != transport && upstream_usable(upstream))
|
||||
if (!(upstream->transport == transport && upstream_usable(upstream)))
|
||||
return 0;
|
||||
if (transport == GETDNS_TRANSPORT_TCP)
|
||||
return 1;
|
||||
|
@ -1765,7 +1765,7 @@ upstream_select_stateful(getdns_network_req *netreq, getdns_transport_list_t tra
|
|||
}
|
||||
}
|
||||
|
||||
if (netreq->owner->context->tls_use_all_upstreams == 0) {
|
||||
if (netreq->owner->context->round_robin_upstreams == 0) {
|
||||
/* First find if an open upstream has the correct properties and use that*/
|
||||
for (i = 0; i < upstreams->count; i++) {
|
||||
if (upstream_valid_and_open(&upstreams->upstreams[i], transport, netreq))
|
||||
|
@ -1793,7 +1793,7 @@ upstream_select_stateful(getdns_network_req *netreq, getdns_transport_list_t tra
|
|||
return NULL;
|
||||
|
||||
/* Now select the specific upstream */
|
||||
if (netreq->owner->context->tls_use_all_upstreams == 0) {
|
||||
if (netreq->owner->context->round_robin_upstreams == 0) {
|
||||
/* Base the decision on the stats, noting we will have started from 0*/
|
||||
for (i++; i < upstreams->count; i++) {
|
||||
if (upstream_valid(&upstreams->upstreams[i], transport, netreq) &&
|
||||
|
|
|
@ -448,9 +448,9 @@
|
|||
ASSERT_RC(getdns_context_set_context_update_callback(context, update_callbackfn),
|
||||
GETDNS_RETURN_GOOD, "Return code from getdns_context_set_context_update_callback()");
|
||||
|
||||
expected_changed_item = GETDNS_CONTEXT_CODE_TLS_USE_ALL_UPSTREAMS;
|
||||
expected_changed_item = GETDNS_CONTEXT_CODE_ROUND_ROBIN_UPSTREAMS;
|
||||
|
||||
ASSERT_RC(getdns_context_set_tls_use_all_upstreams(context, 1),
|
||||
ASSERT_RC(getdns_context_set_round_robin_upstreams(context, 1),
|
||||
GETDNS_RETURN_GOOD, "Return code from getdns_context_set_timeout()");
|
||||
|
||||
CONTEXT_DESTROY;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
, edns_client_subnet_private : 1
|
||||
, listen_addresses: [ 127.0.0.1, 0::1 ]
|
||||
, idle_timeout: 10000
|
||||
, tls_use_all_upstreams: 1
|
||||
, round_robin_upstreams: 1
|
||||
, upstream_recursive_servers:
|
||||
[ { address_data: 145.100.185.15
|
||||
, tls_auth_name: "dnsovertls.sinodun.com"
|
||||
|
|
Loading…
Reference in New Issue