smbd: Fix bug 10284
authorVolker Lendecke <vl@samba.org>
Thu, 21 Nov 2013 20:05:29 +0000 (21:05 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 28 Nov 2013 12:15:20 +0000 (13:15 +0100)
commitc880a384a9063cb970483185dc114792a75eaeae
treeacd17015e3bb4c13dfc6cbf12231b6bacdb0d60b
parent9ad3d28ab37b49fb9297c6bef7fad265edd1b599
smbd: Fix bug 10284

If we msg_read_send on a nonempty channel, we create one
tevent_immediate. If we directly receive another message and from
within the msg_read_send's tevent_req callback we immediately do
another msg_read_send, we end up with two tevent_immediate events for
msg_channel_trigger with just one incoming message. Test to follow.

This patch simplifies msg_channel.c by removing the explicit immediate
events. Instead, it relies on the implicit immediate event available
via tevent_req_defer_callback. For messages received from tdb with
a msg_read_send req pending, we directly finish that request without
putting the message on the queue.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10284
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 6b6920b02905661ae661a894e3bd8d2c744d7003)

Autobuild-User(v4-0-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-0-test): Thu Nov 28 13:15:20 CET 2013 on sn-devel-104
source3/lib/msg_channel.c