<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/10136">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stasis_cache: Stop caching stasis subscription change messages<br><br>Since app_voicemail no longer uses the cache to maintain its state<br>there is no longer a need to cache these messages.<br><br>ASTERISK-27121<br><br>Change-Id: I321c708505f5ad8d00e1b0afc4c27dc2ac12ecb4<br>---<br>M main/stasis_cache.c<br>1 file changed, 3 insertions(+), 22 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/10136/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/stasis_cache.c b/main/stasis_cache.c</span><br><span>index 3e2ab17..d9dd2ac 100644</span><br><span>--- a/main/stasis_cache.c</span><br><span>+++ b/main/stasis_cache.c</span><br><span>@@ -819,29 +819,10 @@</span><br><span> </span><br><span> msg_type = stasis_message_type(message);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ /* There's no longer any need to need to cache every subscribe and unsubscribe */</span><br><span> if (stasis_subscription_change_type() == msg_type) {</span><br><span style="color: hsl(0, 100%, 40%);">- struct stasis_subscription_change *change = stasis_message_data(message);</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- /*</span><br><span style="color: hsl(0, 100%, 40%);">- * If this change type is an unsubscribe, we need to find the original</span><br><span style="color: hsl(0, 100%, 40%);">- * subscribe and remove it from the cache otherwise the cache will</span><br><span style="color: hsl(0, 100%, 40%);">- * continue to grow unabated.</span><br><span style="color: hsl(0, 100%, 40%);">- */</span><br><span style="color: hsl(0, 100%, 40%);">- if (strcmp(change->description, "Unsubscribe") == 0) {</span><br><span style="color: hsl(0, 100%, 40%);">- struct stasis_cache_entry *sub;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_wrlock(caching_topic->cache->entries);</span><br><span style="color: hsl(0, 100%, 40%);">- sub = cache_find(caching_topic->cache->entries, stasis_subscription_change_type(), change->uniqueid);</span><br><span style="color: hsl(0, 100%, 40%);">- if (sub) {</span><br><span style="color: hsl(0, 100%, 40%);">- cache_remove(caching_topic->cache->entries, sub, stasis_message_eid(message));</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(sub);</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_unlock(caching_topic->cache->entries);</span><br><span style="color: hsl(0, 100%, 40%);">- ao2_cleanup(caching_topic_needs_unref);</span><br><span style="color: hsl(0, 100%, 40%);">- return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">- msg_put = message;</span><br><span style="color: hsl(0, 100%, 40%);">- msg = message;</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(caching_topic_needs_unref);</span><br><span style="color: hsl(120, 100%, 40%);">+ return;</span><br><span> } else if (stasis_cache_clear_type() == msg_type) {</span><br><span> /* Cache clear event. */</span><br><span> msg_put = NULL;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10136">change 10136</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/10136"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I321c708505f5ad8d00e1b0afc4c27dc2ac12ecb4 </div>
<div style="display:none"> Gerrit-Change-Number: 10136 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>