From e4dbcc0d5d6c9c68a7f3c437611b726f9f0211cf Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 28 Dec 2005 03:04:40 +0000 Subject: r12531: 'make quicktest' was taking 15 minutes on my system due to failing DNS lookups in load_interfaces(). The reason was my eth0 interface was down, and it was being interpreted as a DNS name. This patch changes load_interfaces() to happening automatically when interfaces are first needed instead of on the startup of every samba binary. This means that (for example) ldbadd doesn't call load_interfaces(), which means no slow DNS lookups. I also reduced the number of static globals in interface.c to 1, and changed from malloc to talloc When you want to force a reload of the interfaces list, you now call unload_interfaces(), which means the next call that needs the interfaces list will reload it (This used to be commit f79d90bd1364b970adb2981b2572e77066431f1e) --- source4/torture/gentest.c | 1 - source4/torture/locktest.c | 1 - source4/torture/locktest2.c | 1 - source4/torture/masktest.c | 1 - 4 files changed, 4 deletions(-) (limited to 'source4/torture') diff --git a/source4/torture/gentest.c b/source4/torture/gentest.c index 9f2bb64b60..abd9921569 100644 --- a/source4/torture/gentest.c +++ b/source4/torture/gentest.c @@ -2149,7 +2149,6 @@ static void usage(void) argv += NSERVERS; lp_load(); - load_interfaces(); servers[0].credentials = cli_credentials_init(talloc_autofree_context()); servers[1].credentials = cli_credentials_init(talloc_autofree_context()); diff --git a/source4/torture/locktest.c b/source4/torture/locktest.c index f302240fa2..a94a6f1ec9 100644 --- a/source4/torture/locktest.c +++ b/source4/torture/locktest.c @@ -478,7 +478,6 @@ static void usage(void) argv += NSERVERS; lp_load(); - load_interfaces(); servers[0] = cli_credentials_init(talloc_autofree_context()); servers[1] = cli_credentials_init(talloc_autofree_context()); diff --git a/source4/torture/locktest2.c b/source4/torture/locktest2.c index 062861a75f..9b1a44e727 100644 --- a/source4/torture/locktest2.c +++ b/source4/torture/locktest2.c @@ -485,7 +485,6 @@ static void usage(void) argv += 4; lp_load(); - load_interfaces(); if (getenv("USER")) { fstrcpy(username,getenv("USER")); diff --git a/source4/torture/masktest.c b/source4/torture/masktest.c index db54a157e1..5e8f973c4c 100644 --- a/source4/torture/masktest.c +++ b/source4/torture/masktest.c @@ -298,7 +298,6 @@ static void usage(void) argv += 1; lp_load(); - load_interfaces(); credentials = cli_credentials_init(talloc_autofree_context()); cli_credentials_guess(credentials); -- cgit