messaging3: Relax the self-send check a bit
authorVolker Lendecke <vl@samba.org>
Wed, 7 May 2014 07:51:59 +0000 (09:51 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 8 May 2014 07:10:12 +0000 (09:10 +0200)
In the future we will have multiple task id's per process. They should all be
able to benefit from the self-send local optimization.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/messages.c

index e722b2a0128593bf7a469ced22d65fd18f3c3231..6778080ac4cd7e728645effebb18a7e5e2415f3a 100644 (file)
@@ -344,7 +344,8 @@ void messaging_deregister(struct messaging_context *ctx, uint32_t msg_type,
 static bool messaging_is_self_send(const struct messaging_context *msg_ctx,
                                   const struct server_id *dst)
 {
-       return server_id_equal(&msg_ctx->id, dst);
+       return ((msg_ctx->id.vnn == dst->vnn) &&
+               (msg_ctx->id.pid == dst->pid));
 }
 
 /*