<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/10081">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Corey Farrell: Looks good to me, but someone else must approve
  Joshua Colp: Looks good to me, but someone else must approve
  George Joseph: Looks good to me, approved
  Jenkins2: Approved for Submit

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">optional_api: Remove unused nonoptreq fields<br><br>As they're not actively used, they only grow stale. The moduleinfo field itself<br>is kept in Asterisk 13/15 for ABI compatibility.<br><br>ASTERISK-28046 #close<br><br>Change-Id: I8df66a7007f807840414bb348511a8c14c05a9fc<br>---<br>M res/ari/ari_model_validators.h<br>M res/res_stasis_test.c<br>M rest-api-templates/ari_model_validators.h.mustache<br>M tests/test_ari_model.c<br>4 files changed, 15 insertions(+), 30 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/ari/ari_model_validators.h b/res/ari/ari_model_validators.h</span><br><span>index 328349b..3c501cf 100644</span><br><span>--- a/res/ari/ari_model_validators.h</span><br><span>+++ b/res/ari/ari_model_validators.h</span><br><span>@@ -23,11 +23,10 @@</span><br><span>  * the validator's function pointer.</span><br><span>  *</span><br><span>  * The reason for this seamingly useless indirection is the way function</span><br><span style="color: hsl(0, 100%, 40%);">- * pointers interfere with module loading. Asterisk attempts to dlopen() each</span><br><span style="color: hsl(0, 100%, 40%);">- * module using \c RTLD_LAZY in order to read some metadata from the module.</span><br><span style="color: hsl(0, 100%, 40%);">- * Unfortunately, if you take the address of a function, the function has to be</span><br><span style="color: hsl(0, 100%, 40%);">- * resolvable at load time, even if \c RTLD_LAZY is specified. By moving the</span><br><span style="color: hsl(0, 100%, 40%);">- * function-address-taking into this module, we can once again be lazy.</span><br><span style="color: hsl(120, 100%, 40%);">+ * pointers used to interfere with module loading. Previously, Asterisk</span><br><span style="color: hsl(120, 100%, 40%);">+ * attempted to dlopen() each module using \c RTLD_LAZY in order to read some</span><br><span style="color: hsl(120, 100%, 40%);">+ * metadata from the module. Using functions to get the function pointer</span><br><span style="color: hsl(120, 100%, 40%);">+ * allowed us to be lazy.</span><br><span>  */</span><br><span> </span><br><span>  /*</span><br><span>diff --git a/res/res_stasis_test.c b/res/res_stasis_test.c</span><br><span>index 19d2a42..416a963 100644</span><br><span>--- a/res/res_stasis_test.c</span><br><span>+++ b/res/res_stasis_test.c</span><br><span>@@ -100,23 +100,10 @@</span><br><span>  * \brief Implementation of the stasis_message_sink_cb() callback.</span><br><span>  *</span><br><span>  * Why the roundabout way of exposing this via stasis_message_sink_cb()? Well,</span><br><span style="color: hsl(0, 100%, 40%);">- * it has to do with how we load modules.</span><br><span style="color: hsl(120, 100%, 40%);">+ * it has to do with how we previously loaded modules, using \c RTLD_LAZY.</span><br><span>  *</span><br><span style="color: hsl(0, 100%, 40%);">- * Modules have their own metadata compiled into them in the module info block</span><br><span style="color: hsl(0, 100%, 40%);">- * at the end of the file.  This includes dependency information in the</span><br><span style="color: hsl(0, 100%, 40%);">- * \c nonoptreq field.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * Asterisk loads the module, inspects the field, then loads any needed</span><br><span style="color: hsl(0, 100%, 40%);">- * dependencies. This works because Asterisk passes \c RTLD_LAZY to the initial</span><br><span style="color: hsl(0, 100%, 40%);">- * dlopen(), which defers binding function references until they are called.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * But when you take the address of a function, that function needs to be</span><br><span style="color: hsl(0, 100%, 40%);">- * available at load time. So if some module used the address of</span><br><span style="color: hsl(0, 100%, 40%);">- * message_sink_cb() directly, and \c res_stasis_test.so wasn't loaded yet, then</span><br><span style="color: hsl(0, 100%, 40%);">- * that module would fail to load.</span><br><span style="color: hsl(0, 100%, 40%);">- *</span><br><span style="color: hsl(0, 100%, 40%);">- * The stasis_message_sink_cb() function gives us a layer of indirection so that</span><br><span style="color: hsl(0, 100%, 40%);">- * the initial lazy binding will still work as expected.</span><br><span style="color: hsl(120, 100%, 40%);">+ * The stasis_message_sink_cb() function gave us a layer of indirection so that</span><br><span style="color: hsl(120, 100%, 40%);">+ * the initial lazy binding would still work as expected.</span><br><span>  */</span><br><span> static void message_sink_cb(void *data, struct stasis_subscription *sub,</span><br><span>    struct stasis_message *message)</span><br><span>diff --git a/rest-api-templates/ari_model_validators.h.mustache b/rest-api-templates/ari_model_validators.h.mustache</span><br><span>index 0223a68..0b055db 100644</span><br><span>--- a/rest-api-templates/ari_model_validators.h.mustache</span><br><span>+++ b/rest-api-templates/ari_model_validators.h.mustache</span><br><span>@@ -23,11 +23,10 @@</span><br><span>  * the validator's function pointer.</span><br><span>  *</span><br><span>  * The reason for this seamingly useless indirection is the way function</span><br><span style="color: hsl(0, 100%, 40%);">- * pointers interfere with module loading. Asterisk attempts to dlopen() each</span><br><span style="color: hsl(0, 100%, 40%);">- * module using \c RTLD_LAZY in order to read some metadata from the module.</span><br><span style="color: hsl(0, 100%, 40%);">- * Unfortunately, if you take the address of a function, the function has to be</span><br><span style="color: hsl(0, 100%, 40%);">- * resolvable at load time, even if \c RTLD_LAZY is specified. By moving the</span><br><span style="color: hsl(0, 100%, 40%);">- * function-address-taking into this module, we can once again be lazy.</span><br><span style="color: hsl(120, 100%, 40%);">+ * pointers used to interfere with module loading. Previously, Asterisk</span><br><span style="color: hsl(120, 100%, 40%);">+ * attempted to dlopen() each module using \c RTLD_LAZY in order to read some</span><br><span style="color: hsl(120, 100%, 40%);">+ * metadata from the module. Using functions to get the function pointer</span><br><span style="color: hsl(120, 100%, 40%);">+ * allowed us to be lazy.</span><br><span>  */</span><br><span> </span><br><span>  /*</span><br><span>diff --git a/tests/test_ari_model.c b/tests/test_ari_model.c</span><br><span>index e5a96cd..1ab42dd 100644</span><br><span>--- a/tests/test_ari_model.c</span><br><span>+++ b/tests/test_ari_model.c</span><br><span>@@ -40,8 +40,8 @@</span><br><span> /*!</span><br><span>  * Wrapper of ast_test_validate_int() so an external function pointer is not used.</span><br><span>  *</span><br><span style="color: hsl(0, 100%, 40%);">- * \note Must do this because using an external function pointer</span><br><span style="color: hsl(0, 100%, 40%);">- * does not play nicely when loading with RTLD_LAZY.</span><br><span style="color: hsl(120, 100%, 40%);">+ * \note We do this because using an external function pointer</span><br><span style="color: hsl(120, 100%, 40%);">+ * did not play nicely when we loaded with RTLD_LAZY.</span><br><span>  */</span><br><span> static int wrap_ast_ari_validate_int(struct ast_json *json)</span><br><span> {</span><br><span>@@ -53,8 +53,8 @@</span><br><span> /*!</span><br><span>  * Wrapper of ast_ari_validate_string() so an external function pointer is not used.</span><br><span>  *</span><br><span style="color: hsl(0, 100%, 40%);">- * \note Must do this because using an external function pointer</span><br><span style="color: hsl(0, 100%, 40%);">- * does not play nicely when loading with RTLD_LAZY.</span><br><span style="color: hsl(120, 100%, 40%);">+ * \note We do this because using an external function pointer</span><br><span style="color: hsl(120, 100%, 40%);">+ * did not play nicely when we loaded with RTLD_LAZY.</span><br><span>  */</span><br><span> static int wrap_ast_ari_validate_string(struct ast_json *json)</span><br><span> {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/10081">change 10081</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/10081"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I8df66a7007f807840414bb348511a8c14c05a9fc </div>
<div style="display:none"> Gerrit-Change-Number: 10081 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>