<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/17736">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: Fix hint updates, allow dup. hints<br><br>A previous patch for ASTERISK_29578 caused a 'leak' of<br>extension state information across queues, causing the<br>state of the first member of unrelated queues to be<br>updated in addition to the correct member. Which queues<br>and members depended on the order of queues in the<br>iterator.<br><br>Additionally, it is possible to use the same 'hint:' on<br>multiple queue members, so the update cannot break out<br>of the update loop early when a match is found.<br><br>ASTERISK-29806 #close<br><br>Change-Id: If2c1d1cc2a752afd9286d79710fc818596e7a7ad<br>---<br>M apps/app_queue.c<br>1 file changed, 2 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/36/17736/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index d03d9f0..ddfa729 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -2708,16 +2708,11 @@</span><br><span> </span><br><span>              miter = ao2_iterator_init(q->members, 0);</span><br><span>                 for (; (m = ao2_iterator_next(&miter)); ao2_ref(m, -1)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                   if (!strcmp(m->state_context, context) && !strcmp(m->state_exten, exten)) {</span><br><span style="color: hsl(0, 100%, 40%);">-                               found = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-                      } else if (!strcmp(m->state_exten, exten) && context_included(m->state_context, context)) {</span><br><span style="color: hsl(120, 100%, 40%);">+                     if (!strcmp(m->state_exten, exten) &&</span><br><span style="color: hsl(120, 100%, 40%);">+                              (!strcmp(m->state_context, context) || context_included(m->state_context, context))) {</span><br><span>                                 /* context could be included in m->state_context. We need to check. */</span><br><span>                            found = 1;</span><br><span style="color: hsl(0, 100%, 40%);">-                      }</span><br><span style="color: hsl(0, 100%, 40%);">-                       if (found) {</span><br><span>                                 update_status(q, m, device_state);</span><br><span style="color: hsl(0, 100%, 40%);">-                              ao2_ref(m, -1);</span><br><span style="color: hsl(0, 100%, 40%);">-                         break;</span><br><span>                       }</span><br><span>            }</span><br><span>            ao2_iterator_destroy(&miter);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/17736">change 17736</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/17736"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: If2c1d1cc2a752afd9286d79710fc818596e7a7ad </div>
<div style="display:none"> Gerrit-Change-Number: 17736 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean@seanbright.com> </div>
<div style="display:none"> Gerrit-CC: Steve Davies <steve@one47.co.uk> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>