From b5c4c5f4209c10f1d6198017f503f09721ebd341 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 8 Aug 2007 03:20:37 +0000 Subject: r24276: don't mark a stream readable until after the messaging setup is 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c index 540744c5ea..08c323fc0a 100644 --- a/source4/smbd/service_stream.c +++ b/source4/smbd/service_stream.c @@ -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); } -- cgit