<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13507">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis.c: Use correct topic name in stasis_topic_pool_delete_topic<br><br>When a topic is created for an object, its name is only<br><object>:<uniqueid><br>For example:<br>bridge:cb68b3a8-fce7-4738-8a17-d7847562f020<br><br>When a topic is added to a pool, its name has the pool's topic<br>name prepended. For example:<br>bridge:all/bridge:cb68b3a8-fce7-4738-8a17-d7847562f020<br><br>The topic_pool_entry's name however, is only what was passed<br>in to stasis_topic_pool_get_topic which is<br>bridge:cb68b3a8-fce7-4738-8a17-d7847562f020<br>That's actually correct because the entry is qualified by the<br>pool that's in.<br><br>When you're ready to delete the entry from the pool, you retrieve<br>the tropic name from the object but since it now has the pool's<br>topic name prepended, it won't be found in the pool container.<br><br>Fix:<br><br>* Modified stasis_topic_pool_delete_topic() to skip past the<br>pool topic's name when searching the container for a pool entry.<br><br>NOTE: This fix is only needed in the Asterisk 17 and master branches.<br><br>ASTERISK-28633<br>Reported by: Joeran Vinzens<br><br>Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6<br>---<br>M main/stasis.c<br>1 file changed, 5 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/07/13507/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/stasis.c b/main/stasis.c</span><br><span>index 9d7c11f..696d067 100644</span><br><span>--- a/main/stasis.c</span><br><span>+++ b/main/stasis.c</span><br><span>@@ -1855,7 +1855,11 @@</span><br><span> </span><br><span> void stasis_topic_pool_delete_topic(struct stasis_topic_pool *pool, const char *topic_name)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_find(pool->pool_container, topic_name, OBJ_SEARCH_KEY | OBJ_NODATA | OBJ_UNLINK);</span><br><span style="color: hsl(120, 100%, 40%);">+ char *temp_topic_name = ast_strdupa(topic_name);</span><br><span style="color: hsl(120, 100%, 40%);">+ int pool_topic_name_len = strlen(stasis_topic_name(pool->pool_topic)); /* Safe */</span><br><span style="color: hsl(120, 100%, 40%);">+ char *new_topic_name = &temp_topic_name[pool_topic_name_len] + 1;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_find(pool->pool_container, new_topic_name, OBJ_SEARCH_KEY | OBJ_NODATA | OBJ_UNLINK);</span><br><span> }</span><br><span> </span><br><span> struct stasis_topic *stasis_topic_pool_get_topic(struct stasis_topic_pool *pool, const char *topic_name)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13507">change 13507</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/+/13507"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 17 </div>
<div style="display:none"> Gerrit-Change-Id: I4396aa69dd83e4ab84c5b91b39293cfdbcf483e6 </div>
<div style="display:none"> Gerrit-Change-Number: 13507 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>