From ac33f6fbd2d55b0eb52b42e0d466be4c39914020 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 5 Jul 2018 14:05:40 +0200 Subject: stream.c: Use non-blocking connect in osmo_stream_cli When establishing a client-side stream connection via libosmo-netif, we must using non-blocking connect if we want to avoid blocking/stalling the entire process. The libosmocore socket API provides the OSMO_SOCK_F_NONBLOCK flag for this. Make use of it! Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6 Related: OS#3383 --- src/stream.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index 9dcb94b..6eb2313 100644 --- a/src/stream.c +++ b/src/stream.c @@ -451,7 +451,7 @@ int osmo_stream_cli_open2(struct osmo_stream_cli *cli, int reconnect) ret = osmo_sock_init2(AF_INET, SOCK_STREAM, cli->proto, cli->local_addr, cli->local_port, cli->addr, cli->port, - OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND); + OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) { if (reconnect) osmo_stream_cli_reconnect(cli); -- cgit v1.2.3