Resurrect the 'cdelay' and 'ldelay' features of /usr/bin/tip.
This commit is contained in:
parent
228266df11
commit
afe650499c
@ -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:
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user