Merge "json: Audit ast_json_* usage for thread safety."

This commit is contained in:
Joshua Colp
2015-12-18 11:57:17 -06:00
committed by Gerrit Code Review
10 changed files with 49 additions and 39 deletions

View File

@@ -2493,12 +2493,12 @@ static struct ast_json *rtcp_report_to_json(struct stasis_message *msg,
}
}
json_rtcp_report = ast_json_pack("{s: i, s: i, s: i, s: O, s: O}",
json_rtcp_report = ast_json_pack("{s: i, s: i, s: i, s: o, s: o}",
"ssrc", payload->report->ssrc,
"type", payload->report->type,
"report_count", payload->report->reception_report_count,
"sender_information", json_rtcp_sender_info ? json_rtcp_sender_info : ast_json_null(),
"report_blocks", json_rtcp_report_blocks);
"sender_information", json_rtcp_sender_info ? ast_json_ref(json_rtcp_sender_info) : ast_json_ref(ast_json_null()),
"report_blocks", ast_json_ref(json_rtcp_report_blocks));
if (!json_rtcp_report) {
return NULL;
}
@@ -2510,10 +2510,10 @@ static struct ast_json *rtcp_report_to_json(struct stasis_message *msg,
}
}
return ast_json_pack("{s: O, s: O, s: O}",
"channel", payload->snapshot ? json_channel : ast_json_null(),
"rtcp_report", json_rtcp_report,
"blob", payload->blob);
return ast_json_pack("{s: o, s: o, s: o}",
"channel", payload->snapshot ? ast_json_ref(json_channel) : ast_json_ref(ast_json_null()),
"rtcp_report", ast_json_ref(json_rtcp_report),
"blob", ast_json_deep_copy(payload->blob));
}
static void rtp_rtcp_report_dtor(void *obj)