supervisor: Make it a HTTP server
[src/app-framework-binder.git] / src / afb-supervision.c
index 0f8a16b..9759524 100644 (file)
@@ -51,7 +51,8 @@
 extern struct afb_config *main_config;
 
 /* api and apiset name */
-static const char supervision_apiname[] = AFS_SURPERVISION_APINAME_INTERNAL;
+static const char supervision_apiname[] = AFS_SURPERVISION_APINAME;
+static const char supervisor_apiname[] = AFS_SURPERVISOR_APINAME;
 
 /* path of the supervision socket */
 static const char supervisor_socket_path[] = AFS_SURPERVISION_SOCKET;
@@ -291,7 +292,6 @@ static const char *verbs[] = {
        "break", "config", "do", "exit", "sclose", "slist", "trace", "wait" };
 enum  {  Break ,  Config ,  Do ,  Exit ,  Sclose ,  Slist ,  Trace ,  Wait  };
 
-
 static void on_supervision_call(void *closure, struct afb_xreq *xreq)
 {
        int i, rc;
@@ -347,9 +347,10 @@ static void on_supervision_call(void *closure, struct afb_xreq *xreq)
                break;
        case Trace:
                if (!trace)
-                       trace = afb_trace_create(supervision_apiname, NULL /* not bound to any session */);
+                       trace = afb_trace_create(supervisor_apiname, NULL /* not bound to any session */);
 
-               req = afb_xreq_unstore((struct afb_stored_req*)xreq);
+               req = xreq_to_req(xreq);
+               add = drop = NULL;
                wrap_json_unpack(args, "{s?o s?o}", "add", &add, "drop", &drop);
                if (add) {
                        rc = afb_trace_add(req, add, trace);