Change in osmo-e1d[master]: e1d: reliably detect EOF (HDLC-FCS 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/+/26701 )

Change subject: e1d: reliably detect EOF (HDLC-FCS mode)
......................................................................

e1d: reliably detect EOF (HDLC-FCS mode)

This patch makes e1d reliably detect EOF on client sockets while in
HDLC-FCS mode.

Change-Id: I0260360643f723f7c721ae67c47dce8df7778694
---
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 bceeecd..341256a 100644
--- a/src/mux_demux.c
+++ b/src/mux_demux.c
@@ -62,7 +62,7 @@
 			LOGPTS(ts, DXFR, LOGL_DEBUG, "RX Message: %d [ %s]\n",
 				rv, osmo_hexdump(ts->hdlc.rx_buf, rv));
 			rv = write(ts->fd, ts->hdlc.rx_buf, bytes_to_write);
-			if (rv < 0)
+			if (rv <= 0)
 				return rv;
 		} else  if (rv < 0 && ts->id == 4) {
 			LOGPTS(ts, DXFR, LOGL_ERROR, "ERR RX: %d %d %d [ %s]\n",
@@ -97,7 +97,7 @@
 					rv, osmo_hexdump(ts->hdlc.tx_buf, rv));
 				ts->hdlc.tx_len = rv;
 				ts->hdlc.tx_ofs = 0;
-			} else if (rv < 0 && errno != EAGAIN)
+			} else if ((rv < 0 && errno != EAGAIN) || rv == 0)
 				return rv;
 		}
 

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

Gerrit-Project: osmo-e1d
Gerrit-Branch: master
Gerrit-Change-Id: I0260360643f723f7c721ae67c47dce8df7778694
Gerrit-Change-Number: 26701
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/f857aed9/attachment.htm>


More information about the gerrit-log mailing list