smbd: Fix bug 10284
authorVolker Lendecke <vl@samba.org>
Thu, 21 Nov 2013 20:05:29 +0000 (21:05 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 26 Nov 2013 19:57:17 +0000 (20:57 +0100)
commit6b6920b02905661ae661a894e3bd8d2c744d7003
tree7f5b629649a6fd06d8b0dd02b91d907c9eb65558
parenta793ac016db95290470515d89c187365bfcb4f18
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>
source3/lib/msg_channel.c