[Asterisk-code-review] SDP: Make ast sdp state set remote sdp() return error. (asterisk[master])

Jenkins2 asteriskteam at digium.com
Mon May 1 17:01:21 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5552 )

Change subject: SDP: Make ast_sdp_state_set_remote_sdp() return error.
......................................................................


SDP: Make ast_sdp_state_set_remote_sdp() return error.

Change-Id: I7707c9d872c476d897ff459008652b35142a35e1
---
M include/asterisk/sdp_state.h
M main/sdp_state.c
2 files changed, 9 insertions(+), 5 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, but someone else must approve
  Jenkins2: Approved for Submit
  Joshua Colp: Looks good to me, approved



diff --git a/include/asterisk/sdp_state.h b/include/asterisk/sdp_state.h
index 1382ed6..88660b6 100644
--- a/include/asterisk/sdp_state.h
+++ b/include/asterisk/sdp_state.h
@@ -146,9 +146,12 @@
  * \param sdp_state
  * \param sdp
  *
+ * \retval 0 Success
+ * \retval non-0 Failure
+ *
  * \since 15
  */
-void ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp);
+int ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp);
 
 /*!
  * \brief Set the remote SDP from an Implementation
diff --git a/main/sdp_state.c b/main/sdp_state.c
index 8534501..2c018b1 100644
--- a/main/sdp_state.c
+++ b/main/sdp_state.c
@@ -1073,7 +1073,7 @@
 	return ast_sdp_translator_from_sdp(sdp_state->translator, sdp);
 }
 
-void ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp)
+int ast_sdp_state_set_remote_sdp(struct ast_sdp_state *sdp_state, const struct ast_sdp *sdp)
 {
 	ast_assert(sdp_state != NULL);
 
@@ -1081,12 +1081,13 @@
 		sdp_state->role = SDP_ROLE_ANSWERER;
 	}
 
-	merge_sdps(sdp_state, sdp);
+	return merge_sdps(sdp_state, sdp);
 }
 
 int ast_sdp_state_set_remote_sdp_from_impl(struct ast_sdp_state *sdp_state, void *remote)
 {
 	struct ast_sdp *sdp;
+	int ret;
 
 	ast_assert(sdp_state != NULL);
 
@@ -1094,9 +1095,9 @@
 	if (!sdp) {
 		return -1;
 	}
-	ast_sdp_state_set_remote_sdp(sdp_state, sdp);
+	ret = ast_sdp_state_set_remote_sdp(sdp_state, sdp);
 	ast_sdp_free(sdp);
-	return 0;
+	return ret;
 }
 
 int ast_sdp_state_reset(struct ast_sdp_state *sdp_state)

-- 
To view, visit https://gerrit.asterisk.org/5552
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7707c9d872c476d897ff459008652b35142a35e1
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-code-review mailing list