Change in osmo-e1d[master]: e1d: reliably detect EOF in _e1_ts_{read, write} (RAW mode)

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

laforge gerrit-no-reply at lists.osmocom.org
Sat Jan 1 14:39:44 UTC 2022


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/26700 )

Change subject: e1d: reliably detect EOF in _e1_ts_{read,write} (RAW mode)
......................................................................

e1d: reliably detect EOF in _e1_ts_{read,write} (RAW mode)

This allows us to reliably detect client disconnection at least in
the case of RAW mode channels.  Even with this patch applied, e1d
still fails to reliably detect client disconnect on HDLC-FCS channels.

Change-Id: Ifb8b91d39b394f9c10c859f3adac85ea47b7653f
---
M src/mux_demux.c
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  tnt: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/src/mux_demux.c b/src/mux_demux.c
index dffc798..bceeecd 100644
--- a/src/mux_demux.c
+++ b/src/mux_demux.c
@@ -147,7 +147,7 @@
 		break;
 	}
 
-	if (l < 0 && errno != EAGAIN) {
+	if ((l < 0 && errno != EAGAIN) || l == 0) {
 		LOGPTS(ts, DE1D, LOGL_ERROR, "dead socket during read: %s\n",
 			strerror(errno));
 		e1_ts_stop(ts);
@@ -293,7 +293,7 @@
 		break;
 	}
 
-	if (rv < 0 && errno != EAGAIN) {
+	if ((rv < 0 && errno != EAGAIN) || rv == 0) {
 		LOGPTS(ts, DE1D, LOGL_ERROR, "dead socket during write: %s\n",
 			strerror(errno));
 		e1_ts_stop(ts);

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/26700
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: Ifb8b91d39b394f9c10c859f3adac85ea47b7653f
Gerrit-Change-Number: 26700
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: tnt <tnt at 246tNt.com>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20220101/b14a62d7/attachment.htm>


More information about the gerrit-log mailing list