From 8781e4d787763a6b50d7b3819b33ace208ff7784 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Oct 1996 01:56:21 +0000 Subject: - changed the default nmbd loop timout to 10 seconds (2 seconds was much too short) - got rid of many unnecessary calls to time(NULL) in nmbd. They were causing it to chew too much CPU time when idle. Now we pass a time value in from the top level. (This used to be commit 3cd7303dbc2118db7084a6d8872403d825c52323) --- source3/nmbd/nmbd.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 5b3fd19491..d8865662c7 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -159,10 +159,9 @@ static void fault_continue(void) /******************************************************************* expire old names from the namelist and server list ******************************************************************/ -static void expire_names_and_servers(void) +static void expire_names_and_servers(time_t t) { static time_t lastrun = 0; - time_t t = time(NULL); if (!lastrun) lastrun = t; if (t < lastrun + 5) return; @@ -298,23 +297,23 @@ static void process(void) listen_for_packets(run_election); run_packet_queue(); - run_elections(); + run_elections(t); - announce_host(); + announce_host(t); - announce_master(); + announce_master(t); - announce_remote(); + announce_remote(t); - query_refresh_names(); + query_refresh_names(t); - expire_names_and_servers(); - expire_netbios_response_entries(); + expire_names_and_servers(t); + expire_netbios_response_entries(t); refresh_my_names(t); - write_browse_list(); - do_browser_lists(); - check_master_browser(); + write_browse_list(t); + do_browser_lists(t); + check_master_browser(t); } } @@ -528,7 +527,7 @@ static void usage(char *pname) DEBUG(3,("Loaded names\n")); - write_browse_list(); + write_browse_list(time(NULL)); DEBUG(3,("Dumped names\n")); -- cgit