aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2023-06-15 22:00:07 +0200
committerDaniel Willmann <dwillmann@sysmocom.de>2023-06-15 22:07:21 +0200
commit4bc6d3054c97279e1a0539e6952c4df6f50ed57a (patch)
treed75ba46eaa820775572c6b4044c67d0f99998706
parentb59825440b1d0882d34d76ff8a82d06c5985e7de (diff)
stream: Remove duplicated code in osmo_stream_cli_create()
Simply call osmo_stream_cli_create2() with name "" Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a
-rw-r--r--src/stream.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/src/stream.c b/src/stream.c
index d46bc78..2ba4cde 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -552,23 +552,7 @@ static void cli_timer_cb(void *data);
*/
struct osmo_stream_cli *osmo_stream_cli_create(void *ctx)
{
- struct osmo_stream_cli *cli;
-
- cli = talloc_zero(ctx, struct osmo_stream_cli);
- if (!cli)
- return NULL;
-
- cli->name = "";
- cli->mode = OSMO_STREAM_MODE_UNKNOWN;
- cli->sk_domain = AF_UNSPEC;
- cli->sk_type = SOCK_STREAM;
- cli->proto = IPPROTO_TCP;
- 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);
-
- return cli;
+ return osmo_stream_cli_create2(ctx, "");
}
static void stream_cli_iofd_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg)