1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-13 13:18:06 +03:00
Commit Graph

20 Commits

Author SHA1 Message Date
Andrew Tridgell
f7b49ecd08 r8821: continue the trend to move to a more OO style of interface for our js
calls. This changes the generated RPC and IRPC calls to use the 'this'
object pointer instead of requiring the passing of the object on each
call. So typical usage is now:

var echo = echo_init();
var io = irpcObj();

status = echo.connect("ncacn_np:server");
assert(status.is_ok);

io.input.in_data = 7;
status = echo.AddOne(io);
assert(status.is_ok);
2007-10-10 13:30:08 -05:00
Andrew Tridgell
57d7a585e8 r8483: switched our generated ejs rpc code over to the new OO interface. This
means we don't pollute the name space, and also makes for faster
startup times as we only create variables for the pipes that we use,
not all pipes
2007-10-10 13:23:08 -05:00
Andrew Tridgell
52db7a052b r8399: move the ejs and esp code closer to the directory layout used by the
upstream sources. This makes it much easier to keep it up to date.

I will separate out the mpr code into lib/appweb/mpr next
2007-10-10 13:22:39 -05:00
Andrew Tridgell
b0f9ddafe9 r8333: merged with latest upstream ejs sources 2007-10-10 13:20:07 -05:00
Andrew Tridgell
570f071b15 r8320: make sure all our returned objects are full objects, which means they
have the toString() and valueOf() default attributes

this allows all our returned objects to be used in logical expressions
2007-10-10 13:20:06 -05:00
Andrew Tridgell
061e20e509 r8284: - fixed some uninitialised variables in the irpc code
- added code to send multiple irpc calls in parallel, to all servers
  that have registered the given name, with output going in
  io.results[i]. This allows you to make rpc calls to multiple servers
  at once, which is needed for clients like smbstatus
2007-10-10 13:19:31 -05:00
Andrew Tridgell
1c6b1102e5 r8281: pass the callnum and rpc interface table directly from the generated
code in pidl for ejs calls. This means that ejs_rpc_call() doesn't
need to scan the rpc tables for the right interface, and doesn't need
to scan for the call name
2007-10-10 13:19:31 -05:00
Andrew Tridgell
1c170138a8 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)
2007-10-10 13:19:30 -05:00
Andrew Tridgell
9c885a7edb r8276: fixed the remaining memory leaks in smbscript. We can now loop doing
lots of rpc calls without memory usage increasing.
2007-10-10 13:19:30 -05:00
Andrew Tridgell
b220756cb4 r8273: fixed some memory leaks in smbscript. This required converting
file_load() to use talloc, which impacted quite a few bits of code,
including our smb.conf processing.

took the opportunity to remove the gloabls in params.c while doing this
2007-10-10 13:19:29 -05:00
Andrew Tridgell
0e54fa4466 r8260: added an init based registration system for the generated ejs rpc code, so
adding a new pipe only involves changes to librpc/config.mk
2007-10-10 13:19:27 -05:00
Andrew Tridgell
12d2092dd8 r8256: - allow rpc calls from non-command line ejs contexts by creating a set
of null credentials to use if cmdline_credentials is not setup

- hide the length and size elements of a lsa_String from js scripts,
  so you can use a lsa_String just as an ordinary string without
  knowing its a structure. We won't do this with all structures, just
  a few core ones that are used often enough to warrant it.

- make sure returned ldb arrays have a length property
2007-10-10 13:19:26 -05:00
Andrew Tridgell
9398b02e4b r8238: - fixed handling of NULL pointers from ejs
- added automatic creation of all constants in IDL as ejs variables
2007-10-10 13:19:23 -05:00
Andrew Tridgell
a8cb2dbdcc r8233: - added support for more base types in pidl ejs
- added auto generation of a header with prototypes for public ejs functions

- make public functions non-static

- fixed allocation of fixed sized arrays

- added 'noejs' flag indicating that a typedef will be handled manually by ejs

- added manual functions for sid and GUID, so they show up as nice
  strings in ejs scripts

This allows ejs to bring in samr, security, lsa and misc IDL functions
2007-10-10 13:19:23 -05:00
Andrew Tridgell
a61cdee384 r8220: added auto-generation of ENUM constants in ejs wrapper. So we can now use the enum name
instead of a integer in ejs scripts making rpc calls
2007-10-10 13:19:21 -05:00
Andrew Tridgell
5f062d7148 r8200: - added stub functions for union pull/push
- kill the js interpreter with an exception on internal errors
2007-10-10 13:19:19 -05:00
Andrew Tridgell
a77c2aa860 r8198: - handled push/pull of simple strings in ejs
- improved the error handling, so the ejs wrappers don't just ignore a type they
  don't handle, instead an exception is issued saying what isn't handled
2007-10-10 13:19:19 -05:00
Andrew Tridgell
14b6436cc5 r8192: updated the glue code for the generated ejs functions from pidl
only handles a small subset of all IDL files so far
2007-10-10 13:19:18 -05:00
Andrew Tridgell
b1ea58ddc4 r8073: a successful rpc call from ejs!
the ejs_echo.c code is the stuff that needs to be auto-generated by
pidl. It only does echo_AddOne so far.

We also need a table for registering these calls. The code is
hard-wired for echo_AddOne for now.
2007-10-10 13:19:05 -05:00
Andrew Tridgell
a782541db3 r8069: the beginnings of code to allow rpc calls to be made from ejs
tpot, note that this shows how you can modify passed in MprVar
variables in C call
2007-10-10 13:19:04 -05:00