channel: Fix topology API locking.

* ast_channel_request_stream_topology_change() must not be called with any
channel locks held.

* ast_channel_stream_topology_changed() must be called with only the
passed channel lock held.

ASTERISK-27212

Change-Id: I843de7956d9f1cc7cc02025aea3463d8fe19c691
This commit is contained in:
Richard Mudgett
2017-08-11 16:31:45 -05:00
parent c86619bab8
commit 9c70c88369
3 changed files with 14 additions and 3 deletions

View File

@@ -1768,7 +1768,9 @@ AST_TEST_DEFINE(stream_topology_change_request_from_application_non_multistream)
ast_test_validate_cleanup(test, change_res == -1, res, done);
ast_test_validate_cleanup(test, !pvt->indicated_change_request, res, done);
ast_channel_lock(mock_channel);
change_res = ast_channel_stream_topology_changed(mock_channel, topology);
ast_channel_unlock(mock_channel);
ast_test_validate_cleanup(test, change_res == -1, res, done);
ast_test_validate_cleanup(test, !pvt->indicated_changed, res, done);
@@ -1876,7 +1878,9 @@ AST_TEST_DEFINE(stream_topology_change_request_from_application)
ast_test_validate_cleanup(test, !change_res, res, done);
ast_test_validate_cleanup(test, pvt->indicated_change_request, res, done);
ast_channel_lock(mock_channel);
change_res = ast_channel_stream_topology_changed(mock_channel, topology);
ast_channel_unlock(mock_channel);
ast_test_validate_cleanup(test, !change_res, res, done);
ast_test_validate_cleanup(test, pvt->indicated_changed, res, done);