summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-01-10 10:52:09 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:37:23 -0500
commit1cd4339b9a2786aa26691ca4f02fa93ab0958b88 (patch)
tree9b09324617e38a651de0a761b3c591fa7deff74a /source4/scripting
parent848e236516ccc15864f7c3d2e05a905f6a81678e (diff)
downloadsamba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.tar.gz
samba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.tar.bz2
samba-1cd4339b9a2786aa26691ca4f02fa93ab0958b88.zip
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)
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/ejs/smbcalls_rpc.c9
1 files changed, 5 insertions, 4 deletions
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);