<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-netif/+/17032">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stream: Rename cli state NONE to CLOSED<br><br>It makes a lot more sense calling it this way since it matches the state<br>of the stream at that point.<br><br>Change-Id: Ic02aec3f7f095e0e0e1f940425f577be5048e98f<br>---<br>M src/stream.c<br>M tests/stream/stream_test.err<br>2 files changed, 6 insertions(+), 6 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/stream.c b/src/stream.c</span><br><span>index 8a063f2..65532d3 100644</span><br><span>--- a/src/stream.c</span><br><span>+++ b/src/stream.c</span><br><span>@@ -129,7 +129,7 @@</span><br><span>  */</span><br><span> </span><br><span> enum osmo_stream_cli_state {</span><br><span style="color: hsl(0, 100%, 40%);">-        STREAM_CLI_STATE_NONE,            /* No fd associated, no timer active */</span><br><span style="color: hsl(120, 100%, 40%);">+        STREAM_CLI_STATE_CLOSED,       /* No fd associated, no timer active */</span><br><span>         STREAM_CLI_STATE_WAIT_RECONNECT, /* No fd associated, has timer active to try to connect again */</span><br><span>         STREAM_CLI_STATE_CONNECTING,    /* Fd associated, but connection not yet confirmed by peer or lower layers */</span><br><span>         STREAM_CLI_STATE_CONNECTED,    /* Fd associated and connection is established */</span><br><span>@@ -137,7 +137,7 @@</span><br><span> };</span><br><span> </span><br><span> static const struct value_string stream_cli_state_names[] = {</span><br><span style="color: hsl(0, 100%, 40%);">-     { STREAM_CLI_STATE_NONE,           "NONE" },</span><br><span style="color: hsl(120, 100%, 40%);">+        { STREAM_CLI_STATE_CLOSED,         "CLOSED" },</span><br><span>     { STREAM_CLI_STATE_WAIT_RECONNECT, "WAIT_RECONNECT" },</span><br><span>     { STREAM_CLI_STATE_CONNECTING,     "CONNECTING" },</span><br><span>         { STREAM_CLI_STATE_CONNECTED,      "CONNECTED" },</span><br><span>@@ -221,7 +221,7 @@</span><br><span>                    cli->disconnect_cb(cli);</span><br><span>  }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-   cli->state = STREAM_CLI_STATE_NONE;</span><br><span style="color: hsl(120, 100%, 40%);">+        cli->state = STREAM_CLI_STATE_CLOSED;</span><br><span> }</span><br><span> </span><br><span> static void osmo_stream_cli_read(struct osmo_stream_cli *cli)</span><br><span>@@ -351,7 +351,7 @@</span><br><span>     cli->ofd.priv_nr = 0;        /* XXX */</span><br><span>    cli->ofd.cb = osmo_stream_cli_fd_cb;</span><br><span>      cli->ofd.data = cli;</span><br><span style="color: hsl(0, 100%, 40%);">- cli->state = STREAM_CLI_STATE_NONE;</span><br><span style="color: hsl(120, 100%, 40%);">+        cli->state = STREAM_CLI_STATE_CLOSED;</span><br><span>     osmo_timer_setup(&cli->timer, cli_timer_cb, cli);</span><br><span>     cli->reconnect_timeout = 5;  /* default is 5 seconds. */</span><br><span>  INIT_LLIST_HEAD(&cli->tx_queue);</span><br><span>@@ -672,7 +672,7 @@</span><br><span>        return 0;</span><br><span> </span><br><span> error_close_socket:</span><br><span style="color: hsl(0, 100%, 40%);">-    cli->state = STREAM_CLI_STATE_NONE;</span><br><span style="color: hsl(120, 100%, 40%);">+        cli->state = STREAM_CLI_STATE_CLOSED;</span><br><span>     close(cli->ofd.fd);</span><br><span>       cli->ofd.fd = -1;</span><br><span>         return -EIO;</span><br><span>diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err</span><br><span>index 69a0b85..0d08c67 100644</span><br><span>--- a/tests/stream/stream_test.err</span><br><span>+++ b/tests/stream/stream_test.err</span><br><span>@@ -38,6 +38,6 @@</span><br><span> </span><br><span> {11.000018} non-reconnecting test step 1 [client OK, server OK], FD reg 1</span><br><span> [CONNECTED] osmo_stream_cli_recv(): connection closed with srv</span><br><span style="color: hsl(0, 100%, 40%);">-[NONE] osmo_stream_cli_reconnect(): not reconnecting, disabled.</span><br><span style="color: hsl(120, 100%, 40%);">+[CLOSED] osmo_stream_cli_reconnect(): not reconnecting, disabled.</span><br><span> </span><br><span> {20.000019} non-reconnecting test step 0 [client OK, server OK], FD reg 0</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-netif/+/17032">change 17032</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/libosmo-netif/+/17032"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-netif </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: Ic02aec3f7f095e0e0e1f940425f577be5048e98f </div>
<div style="display:none"> Gerrit-Change-Number: 17032 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>