s3:smbd: we don't need to call message_dispatch() anymore it's event triggered now
authorStefan Metzmacher <metze@samba.org>
Wed, 21 Jan 2009 06:33:19 +0000 (07:33 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 22 Jan 2009 11:37:31 +0000 (12:37 +0100)
metze

source3/smbd/process.c
source3/smbd/server.c

index 78e66e46203afcae8c5d39bd63e4cf838cfedef6..dc038b6b95b3dca69dea51ea0cdfdfad8c031f7a 100644 (file)
@@ -407,9 +407,6 @@ static void smbd_deferred_open_timer(struct event_context *ev,
        TALLOC_CTX *mem_ctx = talloc_tos();
        uint8_t *inbuf;
 
-       /* TODO: remove this hack */
-       message_dispatch(smbd_messaging_context());
-
        inbuf = (uint8_t *)talloc_memdup(mem_ctx, msg->buf.data,
                                         msg->buf.length);
        if (inbuf == NULL) {
@@ -757,13 +754,6 @@ static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection *
        to.tv_sec = SMBD_SELECT_TIMEOUT;
        to.tv_usec = 0;
 
-       /*
-        * 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(smbd_messaging_context());
-
        /*
         * Setup the select fd sets.
         */
@@ -849,16 +839,8 @@ static NTSTATUS smbd_server_connection_loop_once(struct smbd_server_connection *
                return NT_STATUS_RETRY;
        }
 
-       /*
-        * We've just woken up from a protentially long select sleep.
-        * Ensure we process local messages as we need to synchronously
-        * process any messages from other smbd's to avoid file rename race
-        * conditions. This call is cheap if there are no messages waiting.
-        * JRA.
-        */
-       message_dispatch(smbd_messaging_context());
-
-       return NT_STATUS_OK;
+       /* should not be reached */
+       return NT_STATUS_INTERNAL_ERROR;
 }
 
 /*
@@ -1874,9 +1856,6 @@ static void smbd_server_connection_read_handler(struct smbd_server_connection *c
        TALLOC_CTX *mem_ctx = talloc_tos();
        NTSTATUS status;
 
-       /* TODO: remove this hack */
-       message_dispatch(smbd_messaging_context());
-
        /* TODO: make this completely nonblocking */
 
        status = receive_smb_talloc(mem_ctx, smbd_server_fd(),
index 163d0b81beade2d140c5ae76f9429eb09bfe4a60..505763014eeb755e803116324e594e512a573156 100644 (file)
@@ -573,9 +573,6 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
                fd_set r_fds, w_fds;
                int num;
 
-               /* Ensure we respond to PING and DEBUG messages from the main smbd. */
-               message_dispatch(smbd_messaging_context());
-
                if (got_sig_cld) {
                        pid_t pid;
                        int status;