[asterisk-commits] oej: branch oej/manager-check-trunk r280055 - /team/oej/manager-check-trunk/m...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 28 03:29:24 CDT 2010


Author: oej
Date: Wed Jul 28 03:29:20 2010
New Revision: 280055

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=280055
Log:
Fixes based on Tilghman's review.

Thanks Tilghman

Modified:
    team/oej/manager-check-trunk/main/manager.c

Modified: team/oej/manager-check-trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/manager-check-trunk/main/manager.c?view=diff&rev=280055&r1=280054&r2=280055
==============================================================================
--- team/oej/manager-check-trunk/main/manager.c (original)
+++ team/oej/manager-check-trunk/main/manager.c Wed Jul 28 03:29:20 2010
@@ -6096,12 +6096,13 @@
 		return -1;
 	}
 	AST_STANDARD_APP_ARGS(args, data);
+	ast_strip(args.name);
+	ast_strip(args.param);
 
 	AST_RWLIST_RDLOCK(&users);
 	if (!(user = get_manager_by_name_locked(args.name))) {
 		AST_RWLIST_UNLOCK(&users);
-		ast_log(LOG_ERROR, "There's no manager user called : %s\n", args.name);
-		buf[0] = '\0';
+		ast_log(LOG_ERROR, "There's no manager user called : \"%s\"\n", args.name);
 		return -1;
 	}
 	AST_RWLIST_UNLOCK(&users);
@@ -6110,7 +6111,6 @@
 		snprintf(buf, len, "%d", get_manager_sessions(data));
 	} else {
 		ast_log(LOG_ERROR, "Invalid arguments provided to function AMI_CLIENT: %s\n", args.param);
-		buf[0] = '\0';
 		return -1;
 
 	}
@@ -6123,6 +6123,7 @@
 static struct ast_custom_function managerclient_function = {
 	.name = "AMI_CLIENT",
 	.read = function_amiclient,
+	.read_max = 2;
 };
 
 static int registered = 0;




More information about the asterisk-commits mailing list