mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
bridging: Ensure locking during snapshot creation
While the vast majority of bridge snapshot creation is locked properly, there are currently some instances that are not. This adds the missing locking to ensure bridge state is not malleable during snapshot creation. (closes issue ASTERISK-22904) Review: https://reviewboard.asterisk.org/r/3415/ Reported by: Matt Jordan ........ Merged revisions 412193 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@412194 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -746,7 +746,10 @@ void ast_ari_bridges_create(struct ast_variable *headers,
|
||||
return;
|
||||
}
|
||||
|
||||
ast_bridge_lock(bridge);
|
||||
snapshot = ast_bridge_snapshot_create(bridge);
|
||||
ast_bridge_unlock(bridge);
|
||||
|
||||
if (!snapshot) {
|
||||
ast_ari_response_error(
|
||||
response, 500, "Internal Error",
|
||||
@@ -792,7 +795,10 @@ void ast_ari_bridges_create_or_update_with_id(struct ast_variable *headers,
|
||||
return;
|
||||
}
|
||||
|
||||
ast_bridge_lock(bridge);
|
||||
snapshot = ast_bridge_snapshot_create(bridge);
|
||||
ast_bridge_unlock(bridge);
|
||||
|
||||
if (!snapshot) {
|
||||
ast_ari_response_error(
|
||||
response, 500, "Internal Error",
|
||||
|
Reference in New Issue
Block a user