Module: kamailio
Branch: 4.3
Commit: 5d1fe9db6ef3da2d349a1b77bd441eda19ff7aa0
URL:
https://github.com/kamailio/kamailio/commit/5d1fe9db6ef3da2d349a1b77bd441ed…
Author: kelchy <kelchy(a)bitbucket.org>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2015-07-17T12:25:39+02:00
prevent jansson from shuffling key order in json
(cherry picked from commit 140d0c6fc89d3c72bbd45627ca627e19e45b4e53)
---
Modified: modules/jansson/jansson_utils.c
---
Diff:
https://github.com/kamailio/kamailio/commit/5d1fe9db6ef3da2d349a1b77bd441ed…
Patch:
https://github.com/kamailio/kamailio/commit/5d1fe9db6ef3da2d349a1b77bd441ed…
---
diff --git a/modules/jansson/jansson_utils.c b/modules/jansson/jansson_utils.c
index 85f87ad..4919b0e 100644
--- a/modules/jansson/jansson_utils.c
+++ b/modules/jansson/jansson_utils.c
@@ -33,7 +33,7 @@ int jansson_to_val(pv_value_t* val, char** freeme, json_t* v) {
val->flags = 0;
if(json_is_object(v) || json_is_array(v)) {
- const char* value = json_dumps(v, JSON_COMPACT);
+ const char* value = json_dumps(v, JSON_COMPACT|JSON_PRESERVE_ORDER);
*freeme = (char*)value;
val->rs.s = (char*)value;
val->rs.len = strlen(value);