summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2000-11-21 00:30:15 +0000
committerJeremy Allison <jra@samba.org>2000-11-21 00:30:15 +0000
commit2bd3a436fd6ed218bced476b502d24f317511fb2 (patch)
tree6f3ae1d58e9580fec11b192a3114a515867d9e30 /source3/smbd
parentac4d2775618a9ac3428d60bf667e3b968d634799 (diff)
downloadsamba-2bd3a436fd6ed218bced476b502d24f317511fb2.tar.gz
samba-2bd3a436fd6ed218bced476b502d24f317511fb2.tar.bz2
samba-2bd3a436fd6ed218bced476b502d24f317511fb2.zip
Fix for updating of print queues changed from a local box. Essentially,
this makes sure that the change messages sent to ourselves are handled synchronously w.r.t. other smb packets incoming. Jeremy. (This used to be commit 78a13074455618308d048d1c69f62e660988eb90)
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/process.c13
-rw-r--r--source3/smbd/statcache.c2
2 files changed, 10 insertions, 5 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index dc56534edb..ea0309599f 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -131,9 +131,6 @@ static void async_processing(fd_set *fds, char *buffer, int buffer_len)
reload_services(False);
reload_after_sighup = False;
}
-
- /* check for any pending internal messages */
- message_dispatch();
}
/****************************************************************************
@@ -166,6 +163,15 @@ static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout)
smb_read_error = 0;
+ again:
+
+ /*
+ * Note that this call must be before processing any SMB
+ * messages as we need to synchronously process any messages
+ * we may have sent to ourselves from the previous SMB.
+ */
+ message_dispatch();
+
/*
* Check to see if we already have a message on the smb queue.
* If so - copy and return it.
@@ -187,7 +193,6 @@ static BOOL receive_message_or_smb(char *buffer, int buffer_len, int timeout)
* Setup the select read fd set.
*/
- again:
FD_ZERO(&fds);
FD_SET(smbd_server_fd(),&fds);
maxfd = setup_oplock_select_set(&fds);
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index 8200c277b3..4c885f34f1 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -218,7 +218,7 @@ BOOL stat_cache_lookup(connection_struct *conn, char *name, char *dirpath,
*/
BOOL reset_stat_cache( void )
{
- static BOOL initialised;
+ static BOOL initialised = False;
if (!lp_stat_cache()) return True;
if (!initialised) {