Change in libosmocore[master]: vty: Set TCP_NODELAY on VTY sockets

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

pespin gerrit-no-reply at lists.osmocom.org
Mon Oct 12 13:55:56 UTC 2020


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/20575 )


Change subject: vty: Set TCP_NODELAY on VTY sockets
......................................................................

vty: Set TCP_NODELAY on VTY sockets

VTY is an interactive console over telnet, so for sure we want to
disable Nagle algorithm there so make interaction as quick as possible.

Related: OS#4499
Change-Id: I34f8d3ac70045e48613f67e3c79c2ff49c4d2794
---
M src/vty/telnet_interface.c
1 file changed, 6 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/20575/1

diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c
index cd32e68..a25070b 100644
--- a/src/vty/telnet_interface.c
+++ b/src/vty/telnet_interface.c
@@ -22,6 +22,7 @@
 
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <netinet/tcp.h>
 #include <errno.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -101,6 +102,11 @@
 		return -1;
 	}
 
+	rc = 1;
+	rc = setsockopt(server_socket.fd, IPPROTO_TCP, TCP_NODELAY, &rc, sizeof(rc));
+	if (rc < 0)
+		LOGP(DLGLOBAL, LOGL_ERROR, "Failed to set TCP_NODELAY on VTY socket: %s\n", strerror(errno));
+
 	LOGP(DLGLOBAL, LOGL_NOTICE, "Available via telnet %s %d\n", ip, port);
 	return 0;
 }

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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I34f8d3ac70045e48613f67e3c79c2ff49c4d2794
Gerrit-Change-Number: 20575
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201012/deb114e3/attachment.htm>


More information about the gerrit-log mailing list