<p>Neels Hofmeyr <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.osmocom.org/12715">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo_fsm_inst_state_chg(): set T also for zero timeout<br><br>Before this patch, if timeout_secs == 0 was passed to<br>osmo_fsm_inst_state_chg(), the previous T value remained set in the<br>osmo_fsm_inst->T.<br><br>For example:<br><br> osmo_fsm_inst_state_chg(fi, ST_X, 23, 42);<br> // timer == 23 seconds; fi->T == 42<br> osmo_fsm_inst_state_chg(fi, ST_Y, 0, 0);<br> // no timer; fi->T == 42!<br><br>Instead, always set to the T value passed to osmo_fsm_inst_state_chg().<br><br>Adjust osmo_fsm_inst_state_chg() API doc; need to rephrase to accurately<br>describe the otherwise unchanged behaviour independently from T.<br><br>Verify in fsm_test.c.<br><br>Rationale: it is confusing to have a T number remaining from some past state,<br>especially since the user explicitly passed a T number to<br>osmo_fsm_inst_state_chg(). (Usually we are passing timeout_secs=0, T=0).<br><br>I first thought this behavior was introduced with<br>osmo_fsm_inst_state_chg_keep_timer(), but in fact osmo_fsm_inst_state_chg()<br>behaved this way from the start.<br><br>This shows up in the C test for the upcoming tdef API, where the test result<br>printout was showing some past T value sticking around after FSM state<br>transitions. After this patch, there will be no such confusion.<br><br>Change-Id: I65c7c262674a1bc5f37faeca6aa0320ab0174f3c<br>---<br>M src/fsm.c<br>M tests/fsm/fsm_test.c<br>M tests/fsm/fsm_test.err<br>M tests/fsm/fsm_test.ok<br>4 files changed, 71 insertions(+), 7 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/12715/3</pre><p>To view, visit <a href="https://gerrit.osmocom.org/12715">change 12715</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/12715"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>
<div style="display:none"> Gerrit-Change-Id: I65c7c262674a1bc5f37faeca6aa0320ab0174f3c </div>
<div style="display:none"> Gerrit-Change-Number: 12715 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </div>
<div style="display:none"> Gerrit-Owner: Neels Hofmeyr <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder (1000002) </div>