<p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24823">View Change</a></p><p>2 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24823/2/src/libosmo-mgcp/mgcp_protocol.c">File src/libosmo-mgcp/mgcp_protocol.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.osmocom.org/c/osmo-mgw/+/24823/2/src/libosmo-mgcp/mgcp_protocol.c@1278">Patch Set #2, Line 1278:</a> <code style="font-family:monospace,monospace"> if (!endp->wildcarded_req && llist_count(&endp->conns) <= 0) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Done</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">You just changed the condition syntax, but not the logic here. Of course "<= 0" is the same as "< 1".<br>What I mean is:<br>can llist_count return less than 0? I don't think so, so using "!= 0" would be more clear here.<br>Moreover, llist_count() requires iterating the whole list. This is not needed here. Simply check !llist_empty() which is constant in algorithmic complexity.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24823/2/src/libosmo-mgcp/mgcp_protocol.c@1350">Patch Set #2, Line 1350:</a> <code style="font-family:monospace,monospace">           return create_ok_response(endp, 200, "DLCX", p->trans);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">The endp is still there, it just got rid of all its connected and the state is reset. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">So if the request does not refer to a specific endpoint, which endpoint is selected and passed as "endp" in function handle_delete_con?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-mgw/+/24823">change 24823</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.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.osmocom.org/c/osmo-mgw/+/24823"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-mgw </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I0770cf46d93ab09efe9cafdd56d2e3f1132db189 </div>
<div style="display:none"> Gerrit-Change-Number: 24823 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-CC: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Comment-Date: Wed, 07 Jul 2021 12:09:16 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Comment-In-Reply-To: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>