<p>Patch set 5:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10132">View Change</a></p><p>17 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10132/5//COMMIT_MSG">Commit Message:</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/10132/5//COMMIT_MSG@24">Patch Set #5, Line 24:</a> <code style="font-family:monospace,monospace">Also fixed cleanup in some of the uint tests that not only left</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">s/uint/unit/</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c">File apps/app_voicemail.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/10132/5/apps/app_voicemail.c@1011">Patch Set #5, Line 1011:</a> <code style="font-family:monospace,monospace">#define POLL_LIST_BUCKETS 193</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">You might want to consider 511 buckets to better accommodate larger installations.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@12193">Patch Set #5, Line 12193:</a> <code style="font-family:monospace,monospace"> size_t len = 0;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think you should initialize to 1 for the terminator rather than possibly not ever adding room for it if you don't have a context string.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@12202">Patch Set #5, Line 12202:</a> <code style="font-family:monospace,monospace"> len += strlen(vmu->context) + 2; /* Allow for seperator and terminator */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Just add 1 for the separator and initialize len to 1 for the terminator to guarantee that there will be room for the terminator.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@13182">Patch Set #5, Line 13182:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> struct poll_state *poll_state;<br><br> AST_RWLIST_RDLOCK(&poll_list);<br> AST_RWLIST_TRAVERSE(&poll_list, poll_state, entry) {<br> if (!ast_strlen_zero(poll_state->mailbox)) {<br> imap_logout(poll_state->mailbox);<br> }<br> }<br> AST_RWLIST_UNLOCK(&poll_list);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Woops. This needs to be converted to an ao2_callback.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@13222">Patch Set #5, Line 13222:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> const char *context = astman_get_header(m, "Context");<br> const char *mailbox = astman_get_header(m, "Mailbox");<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is now done for every poll_state in the container.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14138">Patch Set #5, Line 14138:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if ((val = ast_variable_retrieve(cfg, "general", "tps_queue_high"))) {<br> ast_log(LOG_NOTICE, "Parameter tps_queue_high is obsolete and will be ignored\n");<br> }<br> if ((val = ast_variable_retrieve(cfg, "general", "tps_queue_low"))) {<br> ast_log(LOG_NOTICE, "Parameter tps_queue_low is obsolete and will be ignored\n");<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Still need to update configs/samples/voicemail.conf.sample about these two options becoming obsolete or removing them from the file.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14495">Patch Set #5, Line 14495:</a> <code style="font-family:monospace,monospace"> memset(&svm, 0, sizeof(svm));</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">svm is now unused and can be deleted</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14496">Patch Set #5, Line 14496:</a> <code style="font-family:monospace,monospace"> if (!(vmu = find_or_create(testcontext, testmailbox))) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We really should call find_or_create() with the users list locked:</p><p style="white-space: pre-wrap; word-wrap: break-word;">AST_LIST_LOCK(&users);<br>vmu = find_or_create(...);<br>AST_LIST_UNLOCK(&users);<br>if (!vmu) {<br>}</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14618">Patch Set #5, Line 14618:</a> <code style="font-family:monospace,monospace"> free_user(vmu);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">vmu was inserted into the users list so we cannot free it directly. That's what load_config() is doing for us.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14672">Patch Set #5, Line 14672:</a> <code style="font-family:monospace,monospace"> if (!(vmu = find_or_create(testcontext, testmailbox))) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14674">Patch Set #5, Line 14674:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> res = AST_TEST_NOT_RUN;<br> goto end;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">revert. Change not needed if find_or_create() fails.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14678">Patch Set #5, Line 14678:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (vmu != &vmus && !(vmu = find_user(&vmus, testcontext, testmailbox))) {<br> ast_test_status_update(test, "Cannot find vmu structure?!!\n");<br> res = AST_TEST_NOT_RUN;<br> goto end;<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This code makes no sense now as we have just created the vmu. Should delete the code.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14733">Patch Set #5, Line 14733:</a> <code style="font-family:monospace,monospace">end:</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">label no longer needed</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14734">Patch Set #5, Line 14734:</a> <code style="font-family:monospace,monospace"> free_user(vmu);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">same</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14868">Patch Set #5, Line 14868:</a> <code style="font-family:monospace,monospace"> if (!(vmu = find_or_create(testcontext, testmailbox))) {</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">same</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10132/5/apps/app_voicemail.c@14898">Patch Set #5, Line 14898:</a> <code style="font-family:monospace,monospace"> free_user(vmu);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">same</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10132">change 10132</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/10132"/><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: comment </div>
<div style="display:none"> Gerrit-Change-Id: I5cceb737246949f9782955c64425b8bd25a9e9ee </div>
<div style="display:none"> Gerrit-Change-Number: 10132 </div>
<div style="display:none"> Gerrit-PatchSet: 5 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 14 Sep 2018 19:07:32 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>