Commit 464313a4 authored by François Grisez's avatar François Grisez
Browse files

liblinphone_tester: add ability to pass 'none' to --dns-hosts to disable hosts overriding

parent 4175094d
......@@ -26,7 +26,7 @@ static FILE * log_file = NULL;
static const char* liblinphone_helper =
"\t\t\t--domain <test sip domain>\n"
"\t\t\t--auth-domain <test auth domain>\n"
"\t\t\t--dns-hosts </etc/hosts -like file to used to override DNS names (default: tester_hosts)>\n"
"\t\t\t--dns-hosts </etc/hosts -like file to used to override DNS names or 'none' for no overriding (default: tester_hosts)>\n"
......@@ -125,17 +125,19 @@ void reset_counters( stats* counters) {
void configure_lc(LinphoneCore *lc, const char *path, void *user_data) {
char *dnsuserhostspath = NULL;
dnsuserhostspath = userhostsfile[0]=='/' ? ms_strdup(userhostsfile) : ms_strdup_printf("%s/%s", path, userhostsfile);
linphone_core_set_user_data(lc, user_data);
linphone_core_enable_ipv6(lc, liblinphonetester_ipv6);
linphone_core_set_sip_transport_timeout(lc, liblinphonetester_transport_timeout);
linphone_core_set_user_data(lc, user_data);
sal_set_dns_user_hosts_file(linphone_core_get_sal(lc), dnsuserhostspath);
sal_enable_test_features(linphone_core_get_sal(lc), TRUE);
if (strcmp(userhostsfile, "none") != 0) {
char *dnsuserhostspath = strchr(userhostsfile, '/') ? ms_strdup(userhostsfile) : ms_strdup_printf("%s/%s", path, userhostsfile);
sal_set_dns_user_hosts_file(linphone_core_get_sal(lc), dnsuserhostspath);
} else {
bctbx_message("no dns-hosts file used");
LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, LinphoneConfig *config, void *user_data) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment