smbd: Fix bug 10284
commitbfdf0984af539d40bcbfec75b1ee65a2808857a4
authorVolker Lendecke <vl@samba.org>
Thu, 21 Nov 2013 20:05:29 +0000 (21 21:05 +0100)
committerKarolin Seeger <kseeger@samba.org>
Thu, 28 Nov 2013 12:13:48 +0000 (28 13:13 +0100)
tree398b66c1a2906f6083085df114358646a1b5d88d
parent9d44b17573297d277904818d3f230ae423f5b4ea
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-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Thu Nov 28 13:13:48 CET 2013 on sn-devel-104
source3/lib/msg_channel.c