<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/5942">View Change</a></p><div style="white-space:pre-wrap">Approvals:
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;">pjsip_distributor.c: Fix unidentified_requests hash functions.<br><br>The OBJ_SEARCH_xxx defines should not be used as if they were individual<br>bits. They represent a multi-bit enumeration value field.<br><br>Change-Id: I32abc9a475396dab02402a7014357dd94284e17b<br>---<br>M res/res_pjsip/pjsip_distributor.c<br>1 file changed, 18 insertions(+), 8 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/res_pjsip/pjsip_distributor.c b/res/res_pjsip/pjsip_distributor.c<br>index dadde25..7778353 100644<br>--- a/res/res_pjsip/pjsip_distributor.c<br>+++ b/res/res_pjsip/pjsip_distributor.c<br>@@ -827,7 +827,7 @@<br> /* Fall through */<br> case OBJ_SEARCH_KEY:<br> if (strcmp(object_left->src_name, right_key) == 0) {<br>- cmp = CMP_MATCH | CMP_STOP;<br>+ cmp = CMP_MATCH;<br> }<br> break;<br> case OBJ_SEARCH_PARTIAL_KEY:<br>@@ -842,15 +842,25 @@<br> return cmp;<br> }<br> <br>-static int suspects_hash(const void *obj, int flags) {<br>- const struct unidentified_request *object_left = obj;<br>+static int suspects_hash(const void *obj, int flags)<br>+{<br>+ const struct unidentified_request *object;<br>+ const char *key;<br> <br>- if (flags & OBJ_SEARCH_OBJECT) {<br>- return ast_str_hash(object_left->src_name);<br>- } else if (flags & OBJ_SEARCH_KEY) {<br>- return ast_str_hash(obj);<br>+ switch (flags & OBJ_SEARCH_MASK) {<br>+ case OBJ_SEARCH_KEY:<br>+ key = obj;<br>+ break;<br>+ case OBJ_SEARCH_OBJECT:<br>+ object = obj;<br>+ key = object->src_name;<br>+ break;<br>+ default:<br>+ /* Hash can only work on something with a full key. */<br>+ ast_assert(0);<br>+ return 0;<br> }<br>- return -1;<br>+ return ast_str_hash(key);<br> }<br> <br> static struct ao2_container *cli_unid_get_container(const char *regex)<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/5942">change 5942</a>. To unsubscribe, 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/5942"/><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: merged </div>
<div style="display:none"> Gerrit-Change-Id: I32abc9a475396dab02402a7014357dd94284e17b </div>
<div style="display:none"> Gerrit-Change-Number: 5942 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Richard Mudgett <rmudgett@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: Joshua Colp <jcolp@digium.com> </div>