Change in libosmo-netif[master]: stream: Rename cli state NONE to CLOSED

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jan 28 21:42:12 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/17032 )

Change subject: stream: Rename cli state NONE to CLOSED
......................................................................

stream: Rename cli state NONE to CLOSED

It makes a lot more sense calling it this way since it matches the state
of the stream at that point.

Change-Id: Ic02aec3f7f095e0e0e1f940425f577be5048e98f
---
M src/stream.c
M tests/stream/stream_test.err
2 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/src/stream.c b/src/stream.c
index 8a063f2..65532d3 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -129,7 +129,7 @@
  */
 
 enum osmo_stream_cli_state {
-        STREAM_CLI_STATE_NONE, 		 /* No fd associated, no timer active */
+        STREAM_CLI_STATE_CLOSED,	 /* No fd associated, no timer active */
         STREAM_CLI_STATE_WAIT_RECONNECT, /* No fd associated, has timer active to try to connect again */
         STREAM_CLI_STATE_CONNECTING,	 /* Fd associated, but connection not yet confirmed by peer or lower layers */
         STREAM_CLI_STATE_CONNECTED,	 /* Fd associated and connection is established */
@@ -137,7 +137,7 @@
 };
 
 static const struct value_string stream_cli_state_names[] = {
-	{ STREAM_CLI_STATE_NONE,           "NONE" },
+	{ STREAM_CLI_STATE_CLOSED,         "CLOSED" },
 	{ STREAM_CLI_STATE_WAIT_RECONNECT, "WAIT_RECONNECT" },
 	{ STREAM_CLI_STATE_CONNECTING,     "CONNECTING" },
 	{ STREAM_CLI_STATE_CONNECTED,      "CONNECTED" },
@@ -221,7 +221,7 @@
 			cli->disconnect_cb(cli);
 	}
 
-	cli->state = STREAM_CLI_STATE_NONE;
+	cli->state = STREAM_CLI_STATE_CLOSED;
 }
 
 static void osmo_stream_cli_read(struct osmo_stream_cli *cli)
@@ -351,7 +351,7 @@
 	cli->ofd.priv_nr = 0;	/* XXX */
 	cli->ofd.cb = osmo_stream_cli_fd_cb;
 	cli->ofd.data = cli;
-	cli->state = STREAM_CLI_STATE_NONE;
+	cli->state = STREAM_CLI_STATE_CLOSED;
 	osmo_timer_setup(&cli->timer, cli_timer_cb, cli);
 	cli->reconnect_timeout = 5;	/* default is 5 seconds. */
 	INIT_LLIST_HEAD(&cli->tx_queue);
@@ -672,7 +672,7 @@
 	return 0;
 
 error_close_socket:
-	cli->state = STREAM_CLI_STATE_NONE;
+	cli->state = STREAM_CLI_STATE_CLOSED;
 	close(cli->ofd.fd);
 	cli->ofd.fd = -1;
 	return -EIO;
diff --git a/tests/stream/stream_test.err b/tests/stream/stream_test.err
index 69a0b85..0d08c67 100644
--- a/tests/stream/stream_test.err
+++ b/tests/stream/stream_test.err
@@ -38,6 +38,6 @@
 
 {11.000018} non-reconnecting test step 1 [client OK, server OK], FD reg 1
 [CONNECTED] osmo_stream_cli_recv(): connection closed with srv
-[NONE] osmo_stream_cli_reconnect(): not reconnecting, disabled.
+[CLOSED] osmo_stream_cli_reconnect(): not reconnecting, disabled.
 
 {20.000019} non-reconnecting test step 0 [client OK, server OK], FD reg 0

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/17032
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: Ic02aec3f7f095e0e0e1f940425f577be5048e98f
Gerrit-Change-Number: 17032
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200128/f2aae219/attachment.htm>


More information about the gerrit-log mailing list