Fix windows build

This commit is contained in:
Sara Dickinson 2017-12-15 14:12:04 +00:00
parent ac17d4ebed
commit 00d3232ba4
2 changed files with 12 additions and 2 deletions

View File

@ -4677,7 +4677,9 @@ _getdns_context_config_setting(getdns_context *context,
CONTEXT_SETTING_STRING(trust_anchors_verify_CA) CONTEXT_SETTING_STRING(trust_anchors_verify_CA)
CONTEXT_SETTING_STRING(trust_anchors_verify_email) CONTEXT_SETTING_STRING(trust_anchors_verify_email)
CONTEXT_SETTING_STRING(appdata_dir) CONTEXT_SETTING_STRING(appdata_dir)
#ifndef USE_WINSOCK
CONTEXT_SETTING_STRING(resolvconf) CONTEXT_SETTING_STRING(resolvconf)
#endif
CONTEXT_SETTING_STRING(hosts) CONTEXT_SETTING_STRING(hosts)
CONTEXT_SETTING_STRING(CApath) CONTEXT_SETTING_STRING(CApath)
CONTEXT_SETTING_STRING(CAfile) CONTEXT_SETTING_STRING(CAfile)
@ -5149,14 +5151,14 @@ getdns_context *_getdns_context_get_sys_ctxt(
context->mf.mf.ext.free))) context->mf.mf.ext.free)))
DEBUG_ANCHOR("Could not create system context: %s\n" DEBUG_ANCHOR("Could not create system context: %s\n"
, getdns_get_errorstr_by_id(r)); , getdns_get_errorstr_by_id(r));
#ifndef USE_WINSOCK
else if (*context->fchg_resolvconf.fn && else if (*context->fchg_resolvconf.fn &&
(r = getdns_context_set_resolvconf( (r = getdns_context_set_resolvconf(
context->sys_ctxt, context->fchg_resolvconf.fn))) context->sys_ctxt, context->fchg_resolvconf.fn)))
DEBUG_ANCHOR("Could initialize system context with resolvconf " DEBUG_ANCHOR("Could initialize system context with resolvconf "
"\"%s\": %s\n", context->fchg_resolvconf.fn "\"%s\": %s\n", context->fchg_resolvconf.fn
, getdns_get_errorstr_by_id(r)); , getdns_get_errorstr_by_id(r));
#endif
else if (*context->fchg_hosts.fn && else if (*context->fchg_hosts.fn &&
(r = getdns_context_set_hosts( (r = getdns_context_set_hosts(
context->sys_ctxt, context->fchg_hosts.fn))) context->sys_ctxt, context->fchg_hosts.fn)))

View File

@ -91,7 +91,9 @@ static int async = 0, interactive = 0;
static enum { GENERAL, ADDRESS, HOSTNAME, SERVICE } calltype = GENERAL; static enum { GENERAL, ADDRESS, HOSTNAME, SERVICE } calltype = GENERAL;
static int bogus_answers = 0; static int bogus_answers = 0;
static int check_dnssec = 0; static int check_dnssec = 0;
#ifndef USE_WINSOCK
static char *resolvconf = NULL; static char *resolvconf = NULL;
#endif
static int print_api_info = 0, print_trust_anchors = 0; static int print_api_info = 0, print_trust_anchors = 0;
static int get_rrtype(const char *t) static int get_rrtype(const char *t)
@ -256,8 +258,10 @@ print_usage(FILE *out, const char *progname)
fprintf(out, "\t\t(should look like '" EXAMPLE_PIN "')\n"); fprintf(out, "\t\t(should look like '" EXAMPLE_PIN "')\n");
fprintf(out, "\t-m\tSet TLS authentication mode to REQUIRED\n"); fprintf(out, "\t-m\tSet TLS authentication mode to REQUIRED\n");
fprintf(out, "\t-n\tSet TLS authentication mode to NONE (default)\n"); fprintf(out, "\t-n\tSet TLS authentication mode to NONE (default)\n");
#ifndef USE_WINSOCK
fprintf(out, "\t-o <filename>\tSet resolver configuration file path\n"); fprintf(out, "\t-o <filename>\tSet resolver configuration file path\n");
fprintf(out, "\t\t(default = %s)\n", GETDNS_FN_RESOLVCONF); fprintf(out, "\t\t(default = %s)\n", GETDNS_FN_RESOLVCONF);
#endif
fprintf(out, "\t-p\tPretty print response dict (default)\n"); fprintf(out, "\t-p\tPretty print response dict (default)\n");
fprintf(out, "\t-P <blocksize>\tPad TLS queries to a multiple of blocksize\n" fprintf(out, "\t-P <blocksize>\tPad TLS queries to a multiple of blocksize\n"
"\t\t(special values: 0: no padding, 1: sensible default policy)\n"); "\t\t(special values: 0: no padding, 1: sensible default policy)\n");
@ -824,6 +828,7 @@ getdns_return_t parse_args(int argc, char **argv)
getdns_context_set_tls_authentication(context, getdns_context_set_tls_authentication(context,
GETDNS_AUTHENTICATION_REQUIRED); GETDNS_AUTHENTICATION_REQUIRED);
break; break;
#ifndef USE_WINSOCK
case 'o': case 'o':
if (c[1] != 0 || ++i >= argc || !*argv[i]) { if (c[1] != 0 || ++i >= argc || !*argv[i]) {
fprintf(stderr, "<filename>" fprintf(stderr, "<filename>"
@ -832,6 +837,7 @@ getdns_return_t parse_args(int argc, char **argv)
} }
resolvconf = argv[i]; resolvconf = argv[i];
break; break;
#endif
case 'P': case 'P':
if (c[1] != 0 || ++i >= argc || !*argv[i]) { if (c[1] != 0 || ++i >= argc || !*argv[i]) {
fprintf(stderr, "tls_query_padding_blocksize " fprintf(stderr, "tls_query_padding_blocksize "
@ -1733,6 +1739,7 @@ main(int argc, char **argv)
if ((r = parse_args(argc, argv)) && r != CONTINUE) if ((r = parse_args(argc, argv)) && r != CONTINUE)
goto done_destroy_context; goto done_destroy_context;
#ifndef USE_WINSOCK
if (resolvconf) { if (resolvconf) {
if ((r = getdns_context_set_resolvconf(context, resolvconf))) { if ((r = getdns_context_set_resolvconf(context, resolvconf))) {
fprintf(stderr, "Problem initializing with resolvconf: %d\n", (int)r); fprintf(stderr, "Problem initializing with resolvconf: %d\n", (int)r);
@ -1741,6 +1748,7 @@ main(int argc, char **argv)
if ((r = parse_args(argc, argv))) if ((r = parse_args(argc, argv)))
goto done_destroy_context; goto done_destroy_context;
} }
#endif
if (print_api_info) { if (print_api_info) {
getdns_dict *api_information = getdns_dict *api_information =
getdns_context_get_api_information(context); getdns_context_get_api_information(context);