From 1cd4339b9a2786aa26691ca4f02fa93ab0958b88 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 10 Jan 2007 10:52:09 +0000 Subject: r20646: first preparations for cluster enablement. This changes " uint32_t server_id to struct server_id server_id; which allows a server ID to have an node number. The node number will be zero in non-clustered case. This is the most basic hook needed for clustering, and ctdb. (This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb) --- source4/scripting/ejs/smbcalls_rpc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/scripting/ejs') diff --git a/source4/scripting/ejs/smbcalls_rpc.c b/source4/scripting/ejs/smbcalls_rpc.c index 76b5f0d695..4d4e12e855 100644 --- a/source4/scripting/ejs/smbcalls_rpc.c +++ b/source4/scripting/ejs/smbcalls_rpc.c @@ -32,13 +32,14 @@ #include "librpc/rpc/dcerpc_table.h" #include "auth/credentials/credentials.h" #include "librpc/rpc/dcerpc.h" +#include "cluster/cluster.h" /* state of a irpc 'connection' */ struct ejs_irpc_connection { const char *server_name; - uint32_t *dest_ids; + struct server_id *dest_ids; struct messaging_context *msg_ctx; }; @@ -78,7 +79,7 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv) /* create a messaging context, looping as we have no way to allocate temporary server ids automatically */ for (i=0;i<10000;i++) { - p->msg_ctx = messaging_init(p, EJS_ID_BASE + i, ev); + p->msg_ctx = messaging_init(p, cluster_id(EJS_ID_BASE + i), ev); if (p->msg_ctx) break; } if (p->msg_ctx == NULL) { @@ -88,7 +89,7 @@ static int ejs_irpc_connect(MprVarHandle eid, int argc, char **argv) } p->dest_ids = irpc_servers_byname(p->msg_ctx, p->server_name); - if (p->dest_ids == NULL || p->dest_ids[0] == 0) { + if (p->dest_ids == NULL || p->dest_ids[0].id == 0) { talloc_free(p); status = NT_STATUS_OBJECT_NAME_NOT_FOUND; } else { @@ -214,7 +215,7 @@ static int ejs_irpc_call(int eid, struct MprVar *io, goto done; } - for (count=0;p->dest_ids[count];count++) /* noop */ ; + for (count=0;p->dest_ids[count].id;count++) /* noop */ ; /* we need to make a call per server */ reqs = talloc_array(ejs, struct irpc_request *, count); -- cgit