Change in libosmo-netif[master]: stream.c: Use non-blocking connect in osmo_stream_cli

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Thu Jul 5 12:07:42 UTC 2018


Harald Welte has uploaded this change for review. ( https://gerrit.osmocom.org/9888


Change subject: stream.c: Use non-blocking connect in osmo_stream_cli
......................................................................

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
---
M src/stream.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/88/9888/1

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

-- 
To view, visit https://gerrit.osmocom.org/9888
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I9bfcb39b5801a36ef32ca0d1f3eb8236687d7ed6
Gerrit-Change-Number: 9888
Gerrit-PatchSet: 1
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20180705/3ed96483/attachment.htm>


More information about the gerrit-log mailing list