<p><a href="https://gerrit.osmocom.org/10477">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.osmocom.org/#/c/10477/1/src/gprs/gb_proxy.c">File src/gprs/gb_proxy.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/10477/1/src/gprs/gb_proxy.c@347">Patch Set #1, Line 347:</a> <code style="font-family:monospace,monospace">stored_msgs_len</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think this explicit cache of the queue length is prone to danger, expecially as there are a number of lines in between the dequeue and changing this member.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think it's best to introduce something like helper functions msgb_dequeue_count(&queue, &count) and msgb_encqueue_count(&queue, &count).  This way the count is maintained in the exact same function call where the enqueue/dequeue happens.</p><p style="white-space: pre-wrap; word-wrap: break-word;">What do you think? I think as generic helpers in libosmocore this can be useful in other places.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.osmocom.org/10477">change 10477</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/10477"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-sgsn </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I4473be8604f80302df03ffdd5a13280dc072f824 </div>
<div style="display:none"> Gerrit-Change-Number: 10477 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Pau Espin Pedrol <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: Stefan Sperling <ssperling@sysmocom.de> </div>
<div style="display:none"> Gerrit-CC: Harald Welte <laforge@gnumonks.org> </div>
<div style="display:none"> Gerrit-Comment-Date: Fri, 17 Aug 2018 07:36:34 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: No </div>