summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-08-08 03:20:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:01:34 -0500
commitb5c4c5f4209c10f1d6198017f503f09721ebd341 (patch)
tree5e34c163a4f3a1199c95b363d29198800b4e4a10
parent7ee3cbd9eb4c9a6f74061e9a2d0fa6c6fa046b4f (diff)
downloadsamba-b5c4c5f4209c10f1d6198017f503f09721ebd341.tar.gz
samba-b5c4c5f4209c10f1d6198017f503f09721ebd341.tar.bz2
samba-b5c4c5f4209c10f1d6198017f503f09721ebd341.zip
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)
-rw-r--r--source4/smbd/service_stream.c6
1 files changed, 4 insertions, 2 deletions
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);
}