summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2011-05-19 11:29:12 +0200
committerKarolin Seeger <kseeger@samba.org>2011-08-18 21:14:45 +0200
commit004564cd754fc471d0954b79e8d9ba970bceba0e (patch)
tree4d25fb30ecd2ff2028bb38e9afaafe287e5ff745
parent41792ec4f1cf6f90724aa8fc65cecdaa5566fdcf (diff)
downloadsamba-004564cd754fc471d0954b79e8d9ba970bceba0e.tar.gz
Revert "Revert "s3-printing: update parent smbd pcap cache""
This reverts commit ad450870eacb114b3f15941a4478ba25701e035a. Signed-off-by: Günther Deschner <gd@samba.org> (cherry picked from commit ee094b53d7fd9c46bca57b9815993282c63af00c)
-rw-r--r--source3/include/local.h1
-rw-r--r--source3/smbd/process.c4
-rw-r--r--source3/smbd/server.c16
3 files changed, 19 insertions, 2 deletions
diff --git a/source3/include/local.h b/source3/include/local.h
index a88b17be137..d65cc001a91 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -148,6 +148,7 @@
#define LPQ_LOCK_TIMEOUT (5)
#define NMBD_INTERFACES_RELOAD (120)
#define NMBD_UNEXPECTED_TIMEOUT (15)
+#define SMBD_HOUSEKEEPING_INTERVAL SMBD_SELECT_TIMEOUT
/* the following are in milliseconds */
#define LOCK_RETRY_TIMEOUT (100)
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 2abea8f4bcc..4b2e6eb79c2 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -1854,7 +1854,7 @@ void check_reload(time_t t)
|| (t-last_printer_reload_time < 0) )
{
DEBUG( 3,( "Printcap cache time expired.\n"));
- reload_printers();
+ pcap_cache_reload(&reload_printers);
last_printer_reload_time = t;
}
}
@@ -2123,7 +2123,7 @@ void smbd_process(void)
}
if (!(event_add_idle(smbd_event_context(), NULL,
- timeval_set(SMBD_SELECT_TIMEOUT, 0),
+ timeval_set(SMBD_HOUSEKEEPING_INTERVAL, 0),
"housekeeping", housekeeping_fn, NULL))) {
DEBUG(0, ("Could not add housekeeping event\n"));
exit(1);
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 72a15fc5575..6147526172c 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -498,6 +498,14 @@ static bool smbd_open_one_socket(struct smbd_parent_context *parent,
return true;
}
+static bool parent_housekeeping_fn(const struct timeval *now, void *private_data)
+{
+ DEBUG(5, ("houskeeping\n"));
+ /* check if we need to reload services */
+ check_reload(time(NULL));
+ return true;
+}
+
/****************************************************************************
Open the socket communication.
****************************************************************************/
@@ -625,6 +633,14 @@ static bool open_sockets_smbd(struct smbd_parent_context *parent,
claim_connection(NULL,"",
FLAG_MSG_GENERAL|FLAG_MSG_SMBD|FLAG_MSG_DBWRAP);
+ if (!(event_add_idle(smbd_event_context(), NULL,
+ timeval_set(SMBD_HOUSEKEEPING_INTERVAL, 0),
+ "parent_housekeeping", parent_housekeeping_fn,
+ parent))) {
+ DEBUG(0, ("Could not add housekeeping event\n"));
+ exit(1);
+ }
+
/* Listen to messages */
messaging_register(smbd_messaging_context(), NULL,