aboutsummaryrefslogtreecommitdiffstats
path: root/src/afb-websock.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-04-07 17:47:01 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-04-07 17:47:01 +0200
commit83ce3b29a598141f8f28afde655beb07ec78c312 (patch)
tree8dbc96679292414f6960626ab543c9a12b053f43 /src/afb-websock.c
parent94014f46d4751492133f65b12f1dea1cfa36d021 (diff)
split api handling
Change-Id: If0a8fd7e74dacdf9defb3cc9da4a6ae79c34a190 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afb-websock.c')
-rw-r--r--src/afb-websock.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/afb-websock.c b/src/afb-websock.c
index e8f596c7..878df042 100644
--- a/src/afb-websock.c
+++ b/src/afb-websock.c
@@ -367,9 +367,7 @@ static int aws_handle_json(struct afb_websock *aws, struct json_object *obj)
r.data = wsreq;
r.itf = &wsreq_itf;
- rc = afb_apis_handle(r, aws->context, api, lenapi, verb, lenverb);
- if (rc == 0)
- wsreq_fail(wsreq, "ail", "api not found");
+ afb_apis_call(r, aws->context, api, lenapi, verb, lenverb);
return 1;
error:
@@ -414,11 +412,12 @@ static struct afb_arg wsreq_get(struct afb_wsreq *wsreq, const char *name)
if (json_object_object_get_ex(wsreq->request, name, &value)) {
arg.name = name;
arg.value = json_object_get_string(value);
+ arg.size = strlen(arg.value);
} else {
arg.name = NULL;
arg.value = NULL;
+ arg.size = 0;
}
- arg.size = 0;
arg.path = NULL;
return arg;
}