[svn-commits] mmichelson: branch 1.4 r135847 - /branches/1.4/apps/app_skel.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 5 19:27:54 CDT 2008


Author: mmichelson
Date: Tue Aug  5 19:27:54 2008
New Revision: 135847

URL: http://svn.digium.com/view/asterisk?view=rev&rev=135847
Log:
Revert inadvertent changes to app_skel that occurred when
I was testing for a memory leak


Modified:
    branches/1.4/apps/app_skel.c

Modified: branches/1.4/apps/app_skel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_skel.c?view=diff&rev=135847&r1=135846&r2=135847
==============================================================================
--- branches/1.4/apps/app_skel.c (original)
+++ branches/1.4/apps/app_skel.c Tue Aug  5 19:27:54 2008
@@ -46,7 +46,6 @@
 #include "asterisk/module.h"
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
-#include "asterisk/utils.h"
 
 static char *app = "Skel";
 static char *synopsis = 
@@ -73,26 +72,28 @@
 	AST_APP_OPTION_ARG('c', OPTION_C, OPTION_ARG_C),
 });
 
-static void *dogballs(void *shit) 
-{
-	ast_log(LOG_NOTICE, "Oh GOD!! I am a thread magician!!\n");
-	return NULL;
-}
 
 static int app_exec(struct ast_channel *chan, void *data)
 {
-	int i;
+	int res = 0;
+	struct ast_flags flags;
 	struct ast_module_user *u;
-	pthread_t thread;
+	char *parse, *opts[OPTION_ARG_ARRAY_SIZE];
+	AST_DECLARE_APP_ARGS(args,
+		AST_APP_ARG(dummy);
+		AST_APP_ARG(options);
+	);
+
+	if (ast_strlen_zero(data)) {
+		ast_log(LOG_WARNING, "%s requires an argument (dummy|[options])\n", app);
+		return -1;
+	}
 
 	u = ast_module_user_add(chan);
 
 	/* Do our thing here */
 
-	for (i = 0; i < 100; ++i) {
-		ast_pthread_create(&thread, NULL, dogballs, NULL);
-	}
-/*
+	/* We need to make a copy of the input string if we are going to modify it! */
 	parse = ast_strdupa(data);
 
 	AST_STANDARD_APP_ARGS(args, parse);
@@ -111,10 +112,10 @@
 
 	if (ast_test_flag(&flags, OPTION_C))
 		ast_log(LOG_NOTICE, "Option C is set with : %s\n", opts[OPTION_ARG_C] ? opts[OPTION_ARG_C] : "<unspecified>");
-*/
+
 	ast_module_user_remove(u);
 
-	return 0;
+	return res;
 }
 
 static int unload_module(void)




More information about the svn-commits mailing list