Merged revisions 81010 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Mon, 27 Aug 2007 14:56:50 +0000 (14:56 +0000)
committerMark Michelson <mmichelson@digium.com>
Mon, 27 Aug 2007 14:56:50 +0000 (14:56 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81010 | mmichelson | 2007-08-27 09:55:44 -0500 (Mon, 27 Aug 2007) | 3 lines

Found a case where the queue's membercount is off. It does not take into account dynamic members on a reload.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81011 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 3c4bae1..ced7933 100644 (file)
@@ -4115,8 +4115,11 @@ static int reload_queues(int reload)
                                ast_debug(1, "XXX Leaking a little memory :( XXX\n");
                } else {
                        ast_mutex_lock(&q->lock);
-                       for (cur = q->members; cur; cur = cur->next)
+                       for (cur = q->members; cur; cur = cur->next) {
+                               if(cur->dynamic)
+                                       q->membercount++;
                                cur->status = ast_device_state(cur->interface);
+                       }
                        ast_mutex_unlock(&q->lock);
                }
        }