#include "local-def.h"
+#include "afb-plugin.h"
#include "afb-req-itf.h"
#include "afb-apis.h"
free(context);
}
+/*
const struct AFB_restapi *afb_apis_get(int apiidx, int verbidx)
{
assert(0 <= apiidx && apiidx < apis_count);
return idx;
return -1;
}
+*/
int afb_apis_get_apiidx(const char *prefix, size_t length)
{
error_handler = older;
}
-static void handle(struct afb_req req, const struct api_desc *api, const struct AFB_restapi *verb)
+static void handle(struct afb_req req, int idxapi, const struct AFB_restapi *verb)
{
switch(verb->session) {
case AFB_SESSION_CREATE:
+ /*
+ req.context = afb_req_session_create(req, idxapi);
+ if (req.context == NULL)
+ return;
+ break;
+ */
case AFB_SESSION_RENEW:
- /*if (check) new*/
+ /*
+ req.context = afb_req_session_check(req, idxapi, 1);
+ if (req.context == NULL)
+ return;
+ */
break;
case AFB_SESSION_CLOSE:
case AFB_SESSION_CHECK:
- /*check*/
+ /*
+ req.context = afb_req_session_check(req, idxapi, 1);
+ if (req.context == NULL)
+ return;
+ */
break;
case AFB_SESSION_NONE:
default:
}
trapping_handle(req, verb->callback);
- if (verb->session == AFB_SESSION_CLOSE)
- /*close*/;
+ if (verb->session == AFB_SESSION_CLOSE) {
+ /*
+ afb_req_session_close(req);
+ */
+ }
}
int afb_apis_handle(struct afb_req req, const char *api, size_t lenapi, const char *verb, size_t lenverb)
v = a->plugin->apis;
for (j = 0 ; v->name ; j++, v++) {
if (!strncasecmp(v->name, verb, lenverb) && !v->name[lenverb]) {
- handle(req, a, v);
+ handle(req, i, v);
return 1;
}
}