Skip to content

Commit

Permalink
* FIX [hook] Fix that some msgs from external are forwarded to webhoo…
Browse files Browse the repository at this point in the history
…k handler.

Signed-off-by: wanghaemq <wangwei@emqx.io>
  • Loading branch information
wanghaEMQ committed Jan 3, 2024
1 parent 2e716f0 commit 5e91bfd
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions nanomq/webhook_inproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,13 @@ hook_work_cb(void *arg)
body = (char *) nng_msg_body(msg);

root = NULL;
if (exconf->count > 0) {
// Only parse msg when exchange is enabled
root = cJSON_Parse(body);
// TODO Not efficent
// Only parse msg when exchange is enabled
root = cJSON_Parse(body);
cJSON *idjo = cJSON_GetObjectItem(root, "ID");
if (!idjo) {
cJSON_Delete(root);
root = NULL;
}
if (root) {
cJSON *idjo = cJSON_GetObjectItem(root, "ID");
Expand Down

0 comments on commit 5e91bfd

Please sign in to comment.