[asterisk-commits] twilson: branch twilson/config_work r362149 - in /team/twilson/config_work: a...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Apr 16 12:15:57 CDT 2012


Author: twilson
Date: Mon Apr 16 12:15:52 2012
New Revision: 362149

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=362149
Log:
Fix the find_or_create_pvt callback and stuff


Modified:
    team/twilson/config_work/apps/app_skel.c
    team/twilson/config_work/include/asterisk/config.h
    team/twilson/config_work/main/udptl.c

Modified: team/twilson/config_work/apps/app_skel.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/apps/app_skel.c?view=diff&rev=362149&r1=362148&r2=362149
==============================================================================
--- team/twilson/config_work/apps/app_skel.c (original)
+++ team/twilson/config_work/apps/app_skel.c Mon Apr 16 12:15:52 2012
@@ -339,7 +339,11 @@
 static void *skel_find_or_create_pvt(const char *category)
 {
 	RAII_VAR(struct ao2_container *, pvt_container, ao2_global_obj_ref(global_config, PVT_CONTAINER), ao2_cleanup);
-	return pvt_container ? ao2_find(pvt_container, category, OBJ_KEY) : skel_pvt_alloc(category);
+	void *obj;
+	if (!pvt_container || !(obj = ao2_find(pvt_container, category, OBJ_KEY))) {
+		return skel_pvt_alloc(category);
+	}
+	return obj;
 }
 
 static struct skel_pvt_config *skel_pvt_cfg_alloc(const char *cat)

Modified: team/twilson/config_work/include/asterisk/config.h
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/include/asterisk/config.h?view=diff&rev=362149&r1=362148&r2=362149
==============================================================================
--- team/twilson/config_work/include/asterisk/config.h (original)
+++ team/twilson/config_work/include/asterisk/config.h Mon Apr 16 12:15:52 2012
@@ -662,34 +662,32 @@
  *
  * \param arg the string to parse. It is not modified.
  * \param flags combination of ast_parse_flags to specify the
- *	return type and additional checks.
+ * return type and additional checks.
  * \param result pointer to the result. NULL is valid here, and can
- *	be used to perform only the validity checks.
+ * be used to perform only the validity checks.
  * \param ... extra arguments are required according to flags.
  *
  * \retval 0 in case of success, != 0 otherwise.
  * \retval result returns the parsed value in case of success,
- *	the default value in case of error, or it is left unchanged
- *	in case of error and no default specified. Note that in certain
- *	cases (e.g. sockaddr_in, with multi-field return values) some
- *	of the fields in result may be changed even if an error occurs.
+ * the default value in case of error, or it is left unchanged
+ * in case of error and no default specified. Note that in certain
+ * cases (e.g. sockaddr_in, with multi-field return values) some
+ * of the fields in result may be changed even if an error occurs.
  *
  * \details
  * Examples of use:
- *	ast_parse_arg("223", PARSE_INT32|PARSE_IN_RANGE,
- *		&a, -1000, 1000);
- *              returns 0, a = 223
- *	ast_parse_arg("22345", PARSE_INT32|PARSE_IN_RANGE|PARSE_DEFAULT,
- *		&a, 9999, 10, 100);
- *              returns 1, a = 9999
- *  ast_parse_arg("22345ssf", PARSE_UINT32|PARSE_IN_RANGE, &b, 10, 100);
- *		returns 1, b unchanged
- *	ast_parse_arg("12", PARSE_UINT32|PARSE_IN_RANGE|PARSE_RANGE_DEFAULTS, &a, 1, 10);
- *	    returns 1, a = 10
- *  ast_parse_arg("www.foo.biz:44", PARSE_INADDR, &sa);
- *		returns 0, sa contains address and port
- *  ast_parse_arg("www.foo.biz", PARSE_INADDR|PARSE_PORT_REQUIRE, &sa);
- *		returns 1 because port is missing, sa contains address
+ *     ast_parse_arg("223", PARSE_INT32|PARSE_IN_RANGE, &a, -1000, 1000);
+ * returns 0, a = 223
+ *     ast_parse_arg("22345", PARSE_INT32|PARSE_IN_RANGE|PARSE_DEFAULT, &a, 9999, 10, 100);
+ * returns 1, a = 9999
+ *     ast_parse_arg("22345ssf", PARSE_UINT32|PARSE_IN_RANGE, &b, 10, 100);
+ * returns 1, b unchanged
+ *    ast_parse_arg("12", PARSE_UINT32|PARSE_IN_RANGE|PARSE_RANGE_DEFAULTS, &a, 1, 10);
+ * returns 1, a = 10
+ *    ast_parse_arg("www.foo.biz:44", PARSE_INADDR, &sa);
+ * returns 0, sa contains address and port
+ *    ast_parse_arg("www.foo.biz", PARSE_INADDR|PARSE_PORT_REQUIRE, &sa);
+ * returns 1 because port is missing, sa contains address
  */
 int ast_parse_arg(const char *arg, enum ast_parse_flags flags,
         void *result, ...);
@@ -699,7 +697,7 @@
  * string in a switch() statement, yet we need a similar behaviour, with many
  * branches and a break on a matching one.
  * The following somehow simplifies the job: we create a block using
- * the 	CV_START and CV_END macros, and then within the block we can run
+ * the CV_START and CV_END macros, and then within the block we can run
  * actions such as "if (condition) { body; break; }"
  * Additional macros are present to run simple functions (e.g. ast_copy_string)
  * or to pass arguments to ast_parse_arg()

Modified: team/twilson/config_work/main/udptl.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/main/udptl.c?view=diff&rev=362149&r1=362148&r2=362149
==============================================================================
--- team/twilson/config_work/main/udptl.c (original)
+++ team/twilson/config_work/main/udptl.c Mon Apr 16 12:15:52 2012
@@ -178,11 +178,11 @@
 static AST_RWLIST_HEAD_STATIC(protos, ast_udptl_protocol);
 
 struct udptl_global_options {
-	unsigned int start;
-	unsigned int end;
+	unsigned int start; /*< The UDPTL start port */
+	unsigned int end;   /*< The UDPTL end port */
 	unsigned int fecentries;
 	unsigned int fecspan;
-	unsigned int nochecksums; /* Can't use bitfield because it is passed by address */
+	unsigned int nochecksums;
 	unsigned int use_even_ports;
 };
 
@@ -1345,7 +1345,7 @@
 		e->command = "udptl show config";
 		e->usage =
 			"Usage: udptl show config\n"
-			"       Dispaly udptl configuration options\n";
+			"       Display UDPTL configuration options\n";
 		return NULL;
 	case CLI_GENERATE:
 		return NULL;
@@ -1396,7 +1396,7 @@
 static void __ast_udptl_reload(int reload)
 {
 	ast_mutex_lock(&reload_lock);
-	if (aco_process_config(&cfg_info, 0)) {
+	if (aco_process_config(&cfg_info, reload)) {
 		ast_log(LOG_WARNING, "Could not reload udptl config\n");
 	}
 	ast_mutex_unlock(&reload_lock);




More information about the asterisk-commits mailing list