From f3c6f290f0c2ba84d8dbbae8d6d2bb50330a27c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Jul 2005 06:21:03 +0000 Subject: r8280: - added irpc_connect() for connecting to a irpc server by name - make the dcerpc pipe in rpc_connect() a talloc child of the ejs connection variable. That means when the connection variable goes out of scope, the connection is automatically closed. That makes for a more natural interface for closing connections in a scripting language (tpot, you may wish to use mprSetPtrChild() in your smb glue code too) (This used to be commit 1c170138a8e82cb42958b88b94a1d567ffa88a92) --- source4/scripting/ejs/mprutil.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source4/scripting/ejs/mprutil.c') diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index 3c28cb4bf1..c614792d8e 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -270,6 +270,15 @@ void mprSetPtr(struct MprVar *v, const char *propname, const void *p) mprSetVar(v, propname, mprCreatePtrVar(discard_const(p), NULL)); } +/* + set a pointer in a existing MprVar, making it a child of the property +*/ +void mprSetPtrChild(struct MprVar *v, const char *propname, const void *p) +{ + mprSetVar(v, propname, mprCreatePtrVar(discard_const(p), NULL)); + talloc_steal(mprGetProperty(v, propname, NULL), p); +} + /* get a pointer from a MprVar */ -- cgit