<p> Attention is currently required from: Andre Barbosa. </p>
<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16233">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File main/media_cache.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16233/comment/b4f7221c_8371a806">Patch Set #1, Line 192:</a> <code style="font-family:monospace,monospace">      // we unlock to curl the file</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Coding guidelines: Don't use C++ type e.g. // but only use C style /* */</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16233/comment/5a3e87a1_7e319009">Patch Set #1, Line 204:</a> <code style="font-family:monospace,monospace">    //we lock again, before updating cache</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Use /* */ style comment here too</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16233/comment/9f86883f_5ab2af00">Patch Set #1, Line 210:</a> <code style="font-family:monospace,monospace">       if (ast_media_cache_exists(uri)) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">While this call should be okay it 1) locks the cache again (but lock should be re-entrant so fine) 2) if it doesn't find it in the cache is calls ast_bucket_file_retrieve again (which first time through will call again since it's not in the cache yet thus potentially doubling your time)</p><p style="white-space: pre-wrap; word-wrap: break-word;">That said I you should just be able to check to see if it in the cache similar to the above:</p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">bucket_file = ao2_find(media_cache, uri, OBJ_SEARCH_KEY | OBJ_NOLOCK);<br>if (bucket_file) {<br> /* in cache, so un-ref, unlock cache and return */<br>}<br>/* No in cache so add ... */</pre></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16233">change 16233</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/+/16233"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I8d4142b463ae4a1d4c41bff2bf63324821567408 </div>
<div style="display:none"> Gerrit-Change-Number: 16233 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Andre Barbosa <andre.emanuel.barbosa@gmail.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Attention: Andre Barbosa <andre.emanuel.barbosa@gmail.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 13 Aug 2021 16:28:04 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>