diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-10 06:21:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:19:30 -0500 |
commit | f3c6f290f0c2ba84d8dbbae8d6d2bb50330a27c1 (patch) | |
tree | 797cdf2fc1dff0142bf32a1b0634a15a6adcbbe3 /source4/scripting/ejs/mprutil.c | |
parent | d084d6d24109ae615af89776519e7ebd722e9a4c (diff) | |
download | samba-f3c6f290f0c2ba84d8dbbae8d6d2bb50330a27c1.tar.gz |
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)
Diffstat (limited to 'source4/scripting/ejs/mprutil.c')
-rw-r--r-- | source4/scripting/ejs/mprutil.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/scripting/ejs/mprutil.c b/source4/scripting/ejs/mprutil.c index 3c28cb4bf18..c614792d8ef 100644 --- a/source4/scripting/ejs/mprutil.c +++ b/source4/scripting/ejs/mprutil.c @@ -271,6 +271,15 @@ void mprSetPtr(struct MprVar *v, const char *propname, const void *p) } /* + 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 */ void *mprGetPtr(struct MprVar *v, const char *propname) |