mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 02:26:23 +00:00
SDP: Remove sdp_state.remote_capabilities
The sdp_state.remote_capabilities was only used inside merge_sdps() and subsequent calls to merge_sdps() by re-INVITE's would leak them. Change-Id: I0ceb7838ea044cc913e8ad4a255c39c9740ae0ce
This commit is contained in:
@@ -340,9 +340,7 @@ struct ast_sdp_state {
|
|||||||
struct sdp_state_capabilities *negotiated_capabilities;
|
struct sdp_state_capabilities *negotiated_capabilities;
|
||||||
/*! Proposed capabilities */
|
/*! Proposed capabilities */
|
||||||
struct sdp_state_capabilities *proposed_capabilities;
|
struct sdp_state_capabilities *proposed_capabilities;
|
||||||
/*! Remote capabilities, learned through remote SDP */
|
/*! Local SDP. Generated via the options and currently negotiated/proposed capabilities. */
|
||||||
struct ast_stream_topology *remote_capabilities;
|
|
||||||
/*! Local SDP. Generated via the options and local capabilities. */
|
|
||||||
struct ast_sdp *local_sdp;
|
struct ast_sdp *local_sdp;
|
||||||
/*! SDP options. Configured options beyond media capabilities. */
|
/*! SDP options. Configured options beyond media capabilities. */
|
||||||
struct ast_sdp_options *options;
|
struct ast_sdp_options *options;
|
||||||
@@ -389,7 +387,6 @@ void ast_sdp_state_free(struct ast_sdp_state *sdp_state)
|
|||||||
|
|
||||||
sdp_state_capabilities_free(sdp_state->negotiated_capabilities);
|
sdp_state_capabilities_free(sdp_state->negotiated_capabilities);
|
||||||
sdp_state_capabilities_free(sdp_state->proposed_capabilities);
|
sdp_state_capabilities_free(sdp_state->proposed_capabilities);
|
||||||
ast_stream_topology_free(sdp_state->remote_capabilities);
|
|
||||||
ast_sdp_free(sdp_state->local_sdp);
|
ast_sdp_free(sdp_state->local_sdp);
|
||||||
ast_sdp_options_free(sdp_state->options);
|
ast_sdp_options_free(sdp_state->options);
|
||||||
ast_sdp_translator_free(sdp_state->translator);
|
ast_sdp_translator_free(sdp_state->translator);
|
||||||
@@ -1007,15 +1004,17 @@ static struct ast_sdp *sdp_create_from_state(const struct ast_sdp_state *sdp_sta
|
|||||||
static int merge_sdps(struct ast_sdp_state *sdp_state, const struct ast_sdp *remote_sdp)
|
static int merge_sdps(struct ast_sdp_state *sdp_state, const struct ast_sdp *remote_sdp)
|
||||||
{
|
{
|
||||||
struct sdp_state_capabilities *joint_capabilities;
|
struct sdp_state_capabilities *joint_capabilities;
|
||||||
|
struct ast_stream_topology *remote_capabilities;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
sdp_state->remote_capabilities = ast_get_topology_from_sdp(remote_sdp);
|
remote_capabilities = ast_get_topology_from_sdp(remote_sdp);
|
||||||
if (!sdp_state->remote_capabilities) {
|
if (!remote_capabilities) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
joint_capabilities = merge_capabilities(sdp_state->proposed_capabilities,
|
joint_capabilities = merge_capabilities(sdp_state->proposed_capabilities,
|
||||||
sdp_state->remote_capabilities, sdp_state->options, 0);
|
remote_capabilities, sdp_state->options, 0);
|
||||||
|
ast_stream_topology_free(remote_capabilities);
|
||||||
if (!joint_capabilities) {
|
if (!joint_capabilities) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -1114,9 +1113,6 @@ int ast_sdp_state_reset(struct ast_sdp_state *sdp_state)
|
|||||||
ast_sdp_free(sdp_state->local_sdp);
|
ast_sdp_free(sdp_state->local_sdp);
|
||||||
sdp_state->local_sdp = NULL;
|
sdp_state->local_sdp = NULL;
|
||||||
|
|
||||||
ast_stream_topology_free(sdp_state->remote_capabilities);
|
|
||||||
sdp_state->remote_capabilities = NULL;
|
|
||||||
|
|
||||||
set_proposed_capabilities(sdp_state, NULL);
|
set_proposed_capabilities(sdp_state, NULL);
|
||||||
|
|
||||||
sdp_state->role = SDP_ROLE_NOT_SET;
|
sdp_state->role = SDP_ROLE_NOT_SET;
|
||||||
|
Reference in New Issue
Block a user