r24276: don't mark a stream readable until after the messaging setup is
authorAndrew Tridgell <tridge@samba.org>
Wed, 8 Aug 2007 03:20:37 +0000 (03:20 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 20:01:34 +0000 (15:01 -0500)
complete. This is needed because messaging setup with ctdb involve
events, and we don't want a SMB packet to be processed on this stream
until after the stream structure is fully setup
(This used to be commit 8e378051e594372dfb2c00a380ef4bc151021ea2)

source4/smbd/service_stream.c

index 540744c5eab9c72c1ef0bcc4c4f789028449b238..08c323fc0ade7bcf322968b5a1ad850ad4b512d5 100644 (file)
@@ -172,8 +172,7 @@ static void stream_new_connection(struct event_context *ev,
        srv_conn->ops           = stream_socket->ops;
        srv_conn->event.ctx     = ev;
        srv_conn->event.fde     = event_add_fd(ev, srv_conn, socket_get_fd(sock),
-                                              EVENT_FD_READ, 
-                                              stream_io_handler_fde, srv_conn);
+                                              0, stream_io_handler_fde, srv_conn);
 
        if (!socket_check_access(sock, "smbd", lp_hostsallow(-1), lp_hostsdeny(-1))) {
                stream_terminate_connection(srv_conn, "denied by access rules");
@@ -202,6 +201,9 @@ static void stream_new_connection(struct event_context *ev,
        talloc_free(c);
        talloc_free(s);
 
+       /* we're now ready to start receiving events on this stream */
+       EVENT_FD_READABLE(srv_conn->event.fde);
+
        /* call the server specific accept code */
        stream_socket->ops->accept_connection(srv_conn);
 }