daniel has uploaded this change for review.

View Change

stream: Remove duplicated code in osmo_stream_cli_create()

Simply call osmo_stream_cli_create2() with name ""

Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a
---
M src/stream.c
1 file changed, 12 insertions(+), 17 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/28/33328/1
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 @@
*/
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)

To view, visit change 33328. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a
Gerrit-Change-Number: 33328
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann@sysmocom.de>
Gerrit-MessageType: newchange