aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-12 17:39:58 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2014-12-12 17:39:58 +0100
commit687046ba2f0527456ae47365a9709fc939fdaf48 (patch)
treeb40d72ae01ae053707219ee7be5512cf99f03bb4
parent37fcd93a508b52f6f33bf47191bba41cb7367b0d (diff)
ipa: Set the BSC_FD_WRITE in ipa_client_conn_open
When the link is being created BSC_FD_WRITE and BSC_FD_READ are being ored into the flag. When the socket connects the first time the ipa_client_fd_cb function is called and the link->state is moved from connecting to connect. In case the connection drops and ipa_client_conn_open is called again the BSC_FD_WRITE flag might not be set. This means that after the socket is connected, ipa_client_fd_cb will not be called. This means that the updown_cb will not be called until after the first write or read on the socket. It might even lead to missing some data. When re-connecting set the write flag again.
-rw-r--r--src/input/ipa.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/input/ipa.c b/src/input/ipa.c
index e2da6f4e..1ddf8021 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -218,6 +218,7 @@ int ipa_client_conn_open(struct ipa_client_conn *link)
return ret;
}
link->ofd->fd = ret;
+ link->ofd->when |= BSC_FD_WRITE;
if (osmo_fd_register(link->ofd) < 0) {
close(ret);
link->ofd->fd = -1;