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
Fri Dec 31 15:47:24 UTC 2021


laforge has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/01/26701/1

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-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20211231/681c6f89/attachment.htm>


More information about the gerrit-log mailing list