summaryrefslogtreecommitdiffstats
path: root/usr.bin/tip
diff options
context:
space:
mode:
authorbsd <bsd@FreeBSD.org>2000-03-15 15:01:04 +0000
committerbsd <bsd@FreeBSD.org>2000-03-15 15:01:04 +0000
commitafe650499c19e5cf369008f2a4667cddaabe00f6 (patch)
tree2ac878df9bad85314159040a8101d65359dc8870 /usr.bin/tip
parent228266df1122dd0b3102d45629ae1e0d7ae42f31 (diff)
downloadFreeBSD-src-afe650499c19e5cf369008f2a4667cddaabe00f6.zip
FreeBSD-src-afe650499c19e5cf369008f2a4667cddaabe00f6.tar.gz
Resurrect the 'cdelay' and 'ldelay' features of /usr/bin/tip.
Diffstat (limited to 'usr.bin/tip')
-rw-r--r--usr.bin/tip/tip/cmds.c20
-rw-r--r--usr.bin/tip/tip/tip.110
2 files changed, 26 insertions, 4 deletions
diff --git a/usr.bin/tip/tip/cmds.c b/usr.bin/tip/tip/cmds.c
index 5e827e6..ec57346 100644
--- a/usr.bin/tip/tip/cmds.c
+++ b/usr.bin/tip/tip/cmds.c
@@ -48,6 +48,7 @@ static const char rcsid[] =
#include <err.h>
#include <libutil.h>
#include <stdio.h>
+#include <unistd.h>
/*
* tip
@@ -560,6 +561,21 @@ cu_put(cc)
transmit(fd, "\04", line);
}
+
+static int
+nap(msec)
+ int msec; /* milliseconds */
+{
+ if (usleep(msec*1000) != 0) {
+ fprintf ( stderr, "warning: ldelay or cdelay interrupted, "
+ "delay time cut short: %s\n",
+ strerror(errno) );
+ }
+
+ return 0;
+}
+
+
/*
* FTP - send single character
* wait for echo & handle timeout
@@ -573,15 +589,11 @@ send(c)
cc = c;
xpwrite(FD, &cc, 1);
-#ifdef notdef
if (number(value(CDELAY)) > 0 && c != '\r')
nap(number(value(CDELAY)));
-#endif
if (!boolean(value(ECHOCHECK))) {
-#ifdef notdef
if (number(value(LDELAY)) > 0 && c == '\r')
nap(number(value(LDELAY)));
-#endif
return;
}
tryagain:
diff --git a/usr.bin/tip/tip/tip.1 b/usr.bin/tip/tip/tip.1
index a9c083d..8699cc0 100644
--- a/usr.bin/tip/tip/tip.1
+++ b/usr.bin/tip/tip/tip.1
@@ -269,6 +269,11 @@ abbreviated
(num) The baud rate at which the connection was established;
abbreviated
.Ar ba .
+.It Ar chardelay
+(num) Number of milliseconds to delay after the transmission of
+each character;
+abbreviated
+.Ar cdelay .
.It Ar dialtimeout
(num) When dialing a phone number, the time (in seconds)
to wait for a connection to be established; abbreviated
@@ -310,6 +315,11 @@ writes when receiving files; abbreviated
.It Ar host
(str) The name of the host to which you are connected; abbreviated
.Ar ho .
+.It Ar linedelay
+(num) Number of milliseconds to delay after the transmission of
+each line;
+abbreviated
+.Ar ldelay .
.It Ar login
(str) Pathname of a login shell script to run once connected; standard input
and output are redirected to the remote host.
OpenPOWER on IntegriCloud