X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-wsj1.c;h=466b58ad1226dcab7f1595bf246c10e629c88460;hb=refs%2Ftags%2F5.99.2;hp=3876c322feeb844243161dded3cc864cfcf34214;hpb=ca820c65c2b03a24e8936218171c6c1d138fd1f7;p=src%2Fapp-framework-binder.git diff --git a/src/afb-wsj1.c b/src/afb-wsj1.c index 3876c322..466b58ad 100644 --- a/src/afb-wsj1.c +++ b/src/afb-wsj1.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017 "IoT.bzh" + * Copyright (C) 2016, 2017, 2018 "IoT.bzh" * Author: José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -392,6 +392,8 @@ struct json_object *afb_wsj1_msg_object_j(struct afb_wsj1_msg *msg) pthread_mutex_lock(&msg->wsj1->mutex); json_tokener_reset(msg->wsj1->tokener); object = json_tokener_parse_ex(msg->wsj1->tokener, msg->object_s, (int)msg->object_s_length); + if (object == NULL && json_tokener_get_error(msg->wsj1->tokener) == json_tokener_continue) + object = json_tokener_parse_ex(msg->wsj1->tokener, "", 1); pthread_mutex_unlock(&msg->wsj1->mutex); if (object == NULL) { /* lazy error detection of json request. Is it to improve? */