summaryrefslogtreecommitdiff
path: root/source3/nmbd
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-10-07 01:56:21 +0000
committerAndrew Tridgell <tridge@samba.org>1996-10-07 01:56:21 +0000
commit8781e4d787763a6b50d7b3819b33ace208ff7784 (patch)
treee9266e994f66c9ee0de0544d63359aa2ffb09a1a /source3/nmbd
parent21cdd72c33960c4da3607b488e984631487197e1 (diff)
downloadsamba-8781e4d787763a6b50d7b3819b33ace208ff7784.tar.gz
samba-8781e4d787763a6b50d7b3819b33ace208ff7784.tar.bz2
samba-8781e4d787763a6b50d7b3819b33ace208ff7784.zip
- 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)
Diffstat (limited to 'source3/nmbd')
-rw-r--r--source3/nmbd/nmbd.c25
1 files changed, 12 insertions, 13 deletions
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"));