[Asterisk-code-review] res fax.c: Add chan locked precondition comments. (asterisk[master])

Joshua Colp asteriskteam at digium.com
Fri Aug 26 14:02:54 CDT 2016


Joshua Colp has submitted this change and it was merged.

Change subject: res_fax.c: Add chan locked precondition comments.
......................................................................


res_fax.c: Add chan locked precondition comments.

Change-Id: Ic10ae434536bbf7fb7055d6ab36cc50b8748a4e7
---
M res/res_fax.c
1 file changed, 23 insertions(+), 7 deletions(-)

Approvals:
  George Joseph: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, approved; Verified



diff --git a/res/res_fax.c b/res/res_fax.c
index b6fefe2..94c512d 100644
--- a/res/res_fax.c
+++ b/res/res_fax.c
@@ -2880,11 +2880,17 @@
 	return gateway;
 }
 
-/*! \brief Create a fax session and start T.30<->T.38 gateway mode
+/*!
+ * \brief Create a fax session and start T.30<->T.38 gateway mode
+ *
  * \param gateway a fax gateway object
  * \param details fax session details
  * \param chan active channel
- * \return 0 on error 1 on success*/
+ *
+ * \pre chan is locked on entry
+ *
+ * \return 0 on error 1 on success
+ */
 static int fax_gateway_start(struct fax_gateway *gateway, struct ast_fax_session_details *details, struct ast_channel *chan)
 {
 	struct ast_fax_session *s;
@@ -2928,6 +2934,7 @@
 	return 0;
 }
 
+/*! \pre chan is locked on entry */
 static struct ast_frame *fax_gateway_request_t38(struct fax_gateway *gateway, struct ast_channel *chan, struct ast_frame *f)
 {
 	struct ast_frame *fp;
@@ -2966,6 +2973,7 @@
 	return fp;
 }
 
+/*! \pre chan is locked on entry */
 static struct ast_frame *fax_gateway_detect_v21(struct fax_gateway *gateway, struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *active, struct ast_frame *f)
 {
 	struct ast_channel *other = (active == chan) ? peer : chan;
@@ -3002,12 +3010,17 @@
 	}
 }
 
-/*! \brief T38 Gateway Negotiate t38 parameters
+/*!
+ * \brief T38 Gateway Negotiate t38 parameters
+ *
  * \param gateway gateway object
  * \param chan channel running the gateway
  * \param peer channel im bridged too
  * \param active channel the frame originated on
  * \param f the control frame to process
+ *
+ * \pre chan is locked on entry
+ *
  * \return processed control frame or null frame
  */
 static struct ast_frame *fax_gateway_detect_t38(struct fax_gateway *gateway, struct ast_channel *chan, struct ast_channel *peer, struct ast_channel *active, struct ast_frame *f)
@@ -3250,7 +3263,8 @@
 	ao2_ref(gateway, -1);
 }
 
-/*! \brief T.30<->T.38 gateway framehook.
+/*!
+ * \brief T.30<->T.38 gateway framehook.
  *
  * Intercept packets on bridged channels and determine if a T.38 gateway is
  * required. If a gateway is required, start a gateway and handle T.38
@@ -3260,6 +3274,8 @@
  * \param f frame to handle may be NULL
  * \param event framehook event
  * \param data framehook data (struct fax_gateway *)
+ *
+ * \pre chan is locked on entry
  *
  * \return processed frame or NULL when f is NULL or a null frame
  */
@@ -3491,9 +3507,9 @@
 		.disable_inheritance = 1, /* Masquerade inheritance is handled through the datastore fixup */
 	};
 
-    	if (global_fax_debug) {
-        	details->option.debug = AST_FAX_OPTFLAG_TRUE;
-    	}
+	if (global_fax_debug) {
+		details->option.debug = AST_FAX_OPTFLAG_TRUE;
+	}
 
 	ast_string_field_set(details, result, "SUCCESS");
 	ast_string_field_set(details, resultstr, "gateway operation started successfully");

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic10ae434536bbf7fb7055d6ab36cc50b8748a4e7
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>



More information about the asterisk-code-review mailing list