#include "miniMpr.h"
#include "param/param.h"
+#include "lib/events/events.h"
/************************************ Code ************************************/
#if !BLD_APPWEB
return mpr_ctx;
}
+struct event_context *mprEventCtx(void)
+{
+ return event_context_find(mprMemCtx());
+}
+
/* return the loadparm context being used for all ejs variables */
struct loadparm_context *mprLpCtx(void)
{
extern void *mprMemCtx(void);
struct loadparm_context;
extern struct loadparm_context *mprLpCtx(void);
+struct event_context;
+extern struct event_context *mprEventCtx(void);
/* This function needs to be provided by anyone using ejs */
void ejs_exception(const char *reason);
ejsSetErrorMsg(eid, "talloc_new() failed");
return -1;
}
- ev = event_context_find(event_mem_ctx);
+ ev = mprEventCtx();
ctx = libnet_context_init(ev, mprLpCtx());
/* IF we generated a new event context, it will be under here,
msg = c->msg_ctx;
} else {
/* Hope we can find the event context somewhere up there... */
- ev = event_context_find(tmp_ctx);
+ ev = mprEventCtx();
msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, mprLpCtx()),
lp_iconv_convenience(mprLpCtx()), ev);
}
result = 0;
- nt_status = resolve_name(lp_resolve_context(mprLpCtx()), &name, tmp_ctx, &reply_addr, event_context_find(tmp_ctx));
+ nt_status = resolve_name(lp_resolve_context(mprLpCtx()), &name, tmp_ctx, &reply_addr, mprEventCtx());
if (NT_STATUS_IS_OK(nt_status)) {
mprSetPropertyValue(argv[0], "value", mprString(reply_addr));
p->server_name = argv[0];
- ev = event_context_find(p);
+ ev = mprEventCtx();
/* create a messaging context, looping as we have no way to
allocate temporary server ids automatically */
cli_credentials_set_anonymous(creds);
}
- ev = event_context_find(mprMemCtx());
+ ev = mprEventCtx();
status = dcerpc_pipe_connect(this, &p, binding, iface, creds, ev,
mprLpCtx());