<p>Patch set 1:<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/10080">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10080/1/res/res_stasis_test.c">File res/res_stasis_test.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/10080/1/res/res_stasis_test.c@108">Patch Set #1, Line 108:</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;">* Asterisk loads the module, inspects the field, then loads any needed<br> * dependencies. This works because Asterisk passes \c RTLD_LAZY to the initial<br> * dlopen(), which defers binding function references until they are called.<br> *<br> * But when you take the address of a function, that function needs to be<br> * available at load time. So if some module used the address of<br> * message_sink_cb() directly, and \c res_stasis_test.so wasn't loaded yet, then<br> * that module would fail to load.<br> *<br> * The stasis_message_sink_cb() function gives us a layer of indirection so that<br> * the initial lazy binding will still work as expected.<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This whole comment is inaccurate for 16 / master.  The only remaining use of RTLD_LAZY is in `static int is_module_loaded(const char *)` which also uses RTLD_NOLOAD.  Actual module loads now always use RTLD_NOW and just use a loop to retry dlopen if symbols could not initially be resolved.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I'm leaning towards saying that this comment should be replaced with a statement saying that the extra layer of indirection exists because it was required by previous versions of Asterisk.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I don't know enough about this code to say if it's worth getting rid of the indirection, I lean towards just leaving the code as is (not worth changing the API/ABI).</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10080">change 10080</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/10080"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I8df66a7007f807840414bb348511a8c14c05a9fc </div>
<div style="display:none"> Gerrit-Change-Number: 10080 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Walter Doekes <walter+asterisk@wjd.nu> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 11 Sep 2018 17:01:30 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>