Resurrect the 'cdelay' and 'ldelay' features of /usr/bin/tip.

This commit is contained in:
Brian S. Dean 2000-03-15 15:01:04 +00:00
parent 1d013a86ed
commit dcb3b3ca6b
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=58095
2 changed files with 26 additions and 4 deletions

View File

@ -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:

View File

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