#include "afb-session.h"
#include "verbose.h"
#include "afb-common.h"
+#include "afb-export.h"
#include "afb-monitor.h"
#include "afb-hook.h"
#include "afb-hook-flags.h"
+--------------------------------------------------------- */
static void daemonize()
{
- int fd, daemon;
+ int fd = 0, daemon;
const char *output;
pid_t pid;
static void startup_call_current(struct startup_req *sreq)
{
const char *api, *verb, *json;
+ enum json_tokener_error jerr;
sreq->callspec = json_object_get_string(json_object_array_get_idx(sreq->calls, sreq->index)),
api = sreq->callspec;
sreq->verb = strndup(verb + 1, json - verb - 1);
sreq->xreq.request.called_api = sreq->api;
sreq->xreq.request.called_verb = sreq->verb;
- sreq->xreq.json = json_tokener_parse(json + 1);
- if (sreq->api && sreq->verb && sreq->xreq.json) {
+ sreq->xreq.json = json_tokener_parse_verbose(json + 1, &jerr);
+ if (sreq->api && sreq->verb && jerr == json_tokener_success) {
afb_xreq_process(&sreq->xreq, main_apiset);
return;
}
{
const char *tracereq, *traceapi, *traceevt, *traceses, *tracesvc, *traceditf, *traceglob;
const char *workdir, *rootdir, *token, *rootapi;
+ struct json_object *settings;
struct afb_hsrv *hsrv;
int max_session_count, session_timeout, api_timeout;
int no_httpd, http_port;
exit(1);
}
+ settings = NULL;
token = rootapi = tracesvc = traceditf = tracereq =
traceapi = traceevt = traceses = traceglob = NULL;
no_httpd = http_port = 0;
"ss ss s?s"
"si si si"
"s?b s?i s?s"
+ "s?o"
#if !defined(REMOVE_LEGACY_TRACE)
"s?s s?s"
#endif
"port", &http_port,
"rootapi", &rootapi,
+ "set", &settings,
#if !defined(REMOVE_LEGACY_TRACE)
"tracesvc", &tracesvc,
"traceditf", &traceditf,
}
/* configure the daemon */
+ afb_export_set_config(settings);
if (afb_session_init(max_session_count, session_timeout, token)) {
ERROR("initialisation of session manager failed");
goto error;