summaryrefslogtreecommitdiffstats
path: root/usr.bin/rlogin
diff options
context:
space:
mode:
authordg <dg@FreeBSD.org>1995-05-03 06:25:56 +0000
committerdg <dg@FreeBSD.org>1995-05-03 06:25:56 +0000
commit8f856ffcfd3b5de2138f01c117f1b30a60e0cf7d (patch)
tree1294224d1adaea563521b97c874659babd8bc5ac /usr.bin/rlogin
parent623d830a022737f7f9a0d2ebbd4411c46b63243a (diff)
downloadFreeBSD-src-8f856ffcfd3b5de2138f01c117f1b30a60e0cf7d.zip
FreeBSD-src-8f856ffcfd3b5de2138f01c117f1b30a60e0cf7d.tar.gz
Added a "-D" option to set the TCP_NODELAY socket option.
Diffstat (limited to 'usr.bin/rlogin')
-rw-r--r--usr.bin/rlogin/rlogin.17
-rw-r--r--usr.bin/rlogin/rlogin.c16
2 files changed, 18 insertions, 5 deletions
diff --git a/usr.bin/rlogin/rlogin.1 b/usr.bin/rlogin/rlogin.1
index 60da3cc..8f4453a 100644
--- a/usr.bin/rlogin/rlogin.1
+++ b/usr.bin/rlogin/rlogin.1
@@ -39,7 +39,7 @@
.Nd remote login
.Sh SYNOPSIS
.Ar rlogin
-.Op Fl 8EKLdx
+.Op Fl 8DEKLdx
.Op Fl e Ar char
.Op Fl k Ar realm
.Op Fl l Ar username
@@ -63,6 +63,11 @@ option allows an eight-bit input data path at all times; otherwise
parity bits are stripped except when the remote side's stop and start
characters are other than
^S/^Q .
+.It Fl D
+The
+.Fl D
+option sets the TCP_NODELAY socket option which can improve interactive response
+at the expense of increased network load.
.It Fl E
The
.Fl E
diff --git a/usr.bin/rlogin/rlogin.c b/usr.bin/rlogin/rlogin.c
index d9379c2..bdd60a3 100644
--- a/usr.bin/rlogin/rlogin.c
+++ b/usr.bin/rlogin/rlogin.c
@@ -53,6 +53,7 @@ static char sccsid[] = "@(#)rlogin.c 8.1 (Berkeley) 6/6/93";
#include <netinet/in.h>
#include <netinet/in_systm.h>
#include <netinet/ip.h>
+#include <netinet/tcp.h>
#include <errno.h>
#include <fcntl.h>
@@ -150,10 +151,10 @@ main(argc, argv)
struct servent *sp;
struct sgttyb ttyb;
long omask;
- int argoff, ch, dflag, one, uid;
+ int argoff, ch, dflag, Dflag, one, uid;
char *host, *p, *user, term[1024];
- argoff = dflag = 0;
+ argoff = dflag = Dflag = 0;
one = 1;
host = user = NULL;
@@ -172,15 +173,18 @@ main(argc, argv)
}
#ifdef KERBEROS
-#define OPTIONS "8EKLde:k:l:x"
+#define OPTIONS "8DEKLde:k:l:x"
#else
-#define OPTIONS "8EKLde:l:"
+#define OPTIONS "8DEKLde:l:"
#endif
while ((ch = getopt(argc - argoff, argv + argoff, OPTIONS)) != EOF)
switch(ch) {
case '8':
eight = 1;
break;
+ case 'D':
+ Dflag = 1;
+ break;
case 'E':
noescape = 1;
break;
@@ -337,6 +341,10 @@ try_connect:
setsockopt(rem, SOL_SOCKET, SO_DEBUG, &one, sizeof(one)) < 0)
(void)fprintf(stderr, "rlogin: setsockopt: %s.\n",
strerror(errno));
+ if (Dflag &&
+ setsockopt(rem, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)) < 0)
+ perror("rlogin: setsockopt NODELAY (ignored)");
+
one = IPTOS_LOWDELAY;
if (setsockopt(rem, IPPROTO_IP, IP_TOS, (char *)&one, sizeof(int)) < 0)
perror("rlogin: setsockopt TOS (ignored)");
OpenPOWER on IntegriCloud