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
This commit is contained in:
Harald Welte 2018-07-05 14:05:40 +02:00
parent e2fbd3dee4
commit ac33f6fbd2
1 changed files with 1 additions and 1 deletions

View File

@ -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);