[asterisk-commits] kpfleming: trunk r82593 - in /trunk: ./ apps/app_queue.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Sep 17 11:44:14 CDT 2007


Author: kpfleming
Date: Mon Sep 17 11:44:13 2007
New Revision: 82593

URL: http://svn.digium.com/view/asterisk?view=rev&rev=82593
Log:
Merged revisions 82590,82592 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r82590 | kpfleming | 2007-09-17 11:33:30 -0500 (Mon, 17 Sep 2007) | 2 lines

fix a couple of places where a logical member name (if specified) was not used, but instead the direct interface was listed

........
r82592 | kpfleming | 2007-09-17 11:40:12 -0500 (Mon, 17 Sep 2007) | 2 lines

revert a change that wasn't supposed to be committed... doh!

........

Modified:
    trunk/   (props changed)
    trunk/apps/app_queue.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=82593&r1=82592&r2=82593
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Mon Sep 17 11:44:13 2007
@@ -3976,6 +3976,7 @@
 	if (q) {
 		int buflen = 0, count = 0;
 		struct ao2_iterator mem_iter = ao2_iterator_init(q->members, 0);
+		const char *name_to_list;
 
 		while ((m = ao2_iterator_next(&mem_iter))) {
 			/* strcat() is always faster than printf() */
@@ -3983,8 +3984,9 @@
 				strncat(buf + buflen, ",", len - buflen - 1);
 				buflen++;
 			}
-			strncat(buf + buflen, m->interface, len - buflen - 1);
-			buflen += strlen(m->interface);
+			name_to_list = ast_strlen_zero(m->membername) ? m->interface : m->membername;
+			strncat(buf + buflen, name_to_list, len - buflen - 1);
+			buflen += strlen(name_to_list);
 			/* Safeguard against overflow (negative length) */
 			if (buflen >= len - 2) {
 				ao2_ref(m, -1);
@@ -4283,7 +4285,7 @@
 			do_print(s, fd, "   Members: ");
 			mem_iter = ao2_iterator_init(q->members, 0);
 			while ((mem = ao2_iterator_next(&mem_iter))) {
-				ast_str_set(&out, 0, "      %s", mem->interface);
+				ast_str_set(&out, 0, "      %s", ast_strlen_zero(mem->membername) ? mem->interface : mem->membername);
 				if (mem->penalty)
 					ast_str_append(&out, 0, " with penalty %d", mem->penalty);
 				ast_str_append(&out, 0, "%s%s%s (%s)",
@@ -4803,7 +4805,7 @@
 				if (++which > state) {
 					char *tmp;
 					ast_mutex_unlock(&q->lock);
-					tmp = ast_strdup(m->interface);
+					tmp = ast_strdup((ast_strlen_zero(m->membername) ? m->interface : m->membername));
 					ao2_ref(m, -1);
 					return tmp;
 				}




More information about the asterisk-commits mailing list