[svn-commits] mjordan: branch 11 r432970 - /branches/11/main/frame.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Mar 13 21:27:15 CDT 2015


Author: mjordan
Date: Fri Mar 13 21:27:13 2015
New Revision: 432970

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=432970
Log:
main/frame: Don't report empty disallow values as an error

In realtime, it is normal to have a database with both 'allow' and 'disallow'
columns in the schema. It is perfectly valid to have an 'allow' value of
'!all,g722,ulaw,alaw' and no 'disallow' value. Unlike in static conf files,
you can't *not* provide the disallow value. Thus, the empty disallow value
causes a spurious WARNING message, which is kind of annoying.

This patch makes it so that a 'disallow' value with no ... value ... is
ignored. Granted, you can still screw this up as well, as technically
specifying 'disallow=all,!ulaw' allows only ulaw, and then you would have no
'allow' value in your database. But really, why would you do that? WHY?

ASTERISK-16779 #close
Reported by: Atis Lezdins

Modified:
    branches/11/main/frame.c

Modified: branches/11/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/main/frame.c?view=diff&rev=432970&r1=432969&r2=432970
==============================================================================
--- branches/11/main/frame.c (original)
+++ branches/11/main/frame.c Fri Mar 13 21:27:13 2015
@@ -797,6 +797,10 @@
 	char *parse = NULL, *this = NULL, *psize = NULL;
 	struct ast_format format;
 
+	if (!allowing && ast_strlen_zero(list)) {
+		return 0;
+	}
+
 	parse = ast_strdupa(list);
 	while ((this = strsep(&parse, ","))) {
 		iter_allowing = allowing;




More information about the svn-commits mailing list