laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/36354?usp=email )
Change subject: stream_cli.c: Handle read / recvfrom error and close connection
......................................................................
stream_cli.c: Handle read / recvfrom error and close connection
If read or recvfrom fails or returns 0, the connection must be closed.
This is already done when a write / send fails. In both cases the
disconnect callback is called to notify the user's client.
Not handling the error may cause an infinite loop of read or recvfrom
failures.
Related: OS#6405
Change-Id: I55426de6b49cb4cb0797e50dfeae11f2efc29b15
---
M src/stream_cli.c
1 file changed, 28 insertions(+), 3 deletions(-)
Approvals:
pespin: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/src/stream_cli.c b/src/stream_cli.c
index fa43a22..11c88ae 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -449,9 +449,13 @@
stream_cli_handle_connecting(cli, res);
break;
case STREAM_CLI_STATE_CONNECTED:
- if (res == 0)
+ if (res <= 0) {
+ LOGSCLI(cli, LOGL_NOTICE, "received result %d in response to read\n", res);
osmo_stream_cli_reconnect(cli);
- else if (cli->iofd_read_cb)
+ msgb_free(msg);
+ break;
+ }
+ if (cli->iofd_read_cb)
cli->iofd_read_cb(cli, msg);
else
msgb_free(msg);
@@ -500,8 +504,12 @@
stream_cli_handle_connecting(cli, res);
break;
case STREAM_CLI_STATE_CONNECTED:
- if (res == 0)
+ if (res <= 0) {
+ LOGSCLI(cli, LOGL_NOTICE, "received result %d in response to recvmsg\n", res);
osmo_stream_cli_reconnect(cli);
+ msgb_free(msg);
+ break;
+ }
/* Forward message to read callback, also if the connection failed. */
if (cli->iofd_read_cb)
cli->iofd_read_cb(cli, msg);
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/36354?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I55426de6b49cb4cb0797e50dfeae11f2efc29b15
Gerrit-Change-Number: 36354
Gerrit-PatchSet: 3
Gerrit-Owner: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: Hoernchen, pespin.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/36373?usp=email )
Change subject: ms: make app configurable
......................................................................
Patch Set 4:
(1 comment)
File Transceiver52M/ms/ms_upper.cpp:
https://gerrit.osmocom.org/c/osmo-trx/+/36373/comment/331c274e_ab0f82cf
PS4, Line 209: // pow = energyDetect(sv, 20 * 4 /*sps*/);
> This is related to the build failure, it doesn't matter right now, that code might be reintroduced a […]
I don't see how "it doesn't matter right now" is a valid argumetn for mixing differnt orthogonal topics in one patch.
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/36373?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: Ibd432f7abbd00065a59104d2c006b676d5db7b47
Gerrit-Change-Number: 36373
Gerrit-PatchSet: 4
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 22 Mar 2024 07:33:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Hoernchen <ewild(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: Hoernchen.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-trx/+/36377?usp=email )
Change subject: ms: disabe uhd ms build
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File Transceiver52M/Makefile.am:
https://gerrit.osmocom.org/c/osmo-trx/+/36377/comment/90c673ee_969bd621
PS1, Line 130: #if ENABLE_MS_TRX
might be worth adding a reason in a comment here, not just in the commit log. This way a potential future reader of the file knows why it is disabled without having to go to git blame or git log.
--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/36377?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I9db1740b5c399a02a41b1d07792c645cf7d1bd1b
Gerrit-Change-Number: 36377
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 22 Mar 2024 07:30:25 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment