From d097ea490525e7a35739dae6a295fd03ba52cfc0 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 5 Jan 2005 16:20:35 +0000 Subject: r4539: patch from Rob -- adding real printcap name cache function to speed up printcap reloads (This used to be commit 1cad5250932b963c2eb9b775221b13db386d601b) --- source3/smbd/process.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'source3/smbd/process.c') diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 1372ebbf45..54837c3b9a 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -1282,7 +1282,7 @@ static int setup_select_timeout(void) void check_reload(int t) { static time_t last_smb_conf_reload_time = 0; - static time_t last_load_printers_reload_time = 0; + static time_t last_printer_reload_time = 0; time_t printcap_cache_time = (time_t)lp_printcap_cache_time(); if(last_smb_conf_reload_time == 0) { @@ -1291,9 +1291,9 @@ void check_reload(int t) Then no printer is available till the first printers check is performed. A lower initial interval circumvents this. */ if ( printcap_cache_time > 60 ) - last_load_printers_reload_time = t - printcap_cache_time + 60; + last_printer_reload_time = t - printcap_cache_time + 60; else - last_load_printers_reload_time = t; + last_printer_reload_time = t; } if (reload_after_sighup || (t >= last_smb_conf_reload_time+SMBD_RELOAD_CHECK)) { @@ -1308,13 +1308,12 @@ void check_reload(int t) { /* see if it's time to reload or if the clock has been set back */ - if ( (t >= last_load_printers_reload_time+printcap_cache_time) - || (t-last_load_printers_reload_time < 0) ) + if ( (t >= last_printer_reload_time+printcap_cache_time) + || (t-last_printer_reload_time < 0) ) { DEBUG( 3,( "Printcap cache time expired.\n")); - remove_stale_printers(); - load_printers(); - last_load_printers_reload_time = t; + reload_printers(); + last_printer_reload_time = t; } } } -- cgit