4 Commits

Author SHA1 Message Date
Kim Woelders 50a6b600bf ttynvt version 0.15 2022-08-10 07:25:52 +02:00
Kim Woelders 465f31ba87 Avoid some cast-qual warnings 2022-01-16 20:10:48 +01:00
Frank Rolsted Jensen 90c5387613 Clear pollin flag when input buffer is flushed
The pollin flag must be cleared when the input buffer (pty slave) is
flushed. This ensures that the POLLIN event is not signaled to the application,
when there is not data to read.
2022-01-16 19:43:37 +01:00
Frank Rolsted Jensen 6bf10a6901 Support for software flow control 2021-10-29 17:57:34 +02:00
3 changed files with 18 additions and 7 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
m4_define([pkg_version], [0.14])
m4_define([pkg_version], [0.15])
#m4_define([pkg_revision], [005])
m4_define([pkg_version], m4_ifdef([pkg_revision], [pkg_version.pkg_revision], [pkg_version]))
+2 -1
View File
@@ -60,11 +60,12 @@ extern void telnet_rfc2217_ctl(tn_ctx_t * tcc, unsigned int val);
/*RFC2217 control commands*/
#define TNS_CTL_NOFLOW 1
#define TNS_CTL_XONOFF 2
#define TNS_CTL_XONOFF_OUT 2
#define TNS_CTL_CTSRTS 3
#define TNS_CTL_DTR_ON 8
#define TNS_CTL_DTR_OFF 9
#define TNS_CTL_RTS_ON 11
#define TNS_CTL_RTS_OFF 12
#define TNS_CTL_XONOFF_IN 15
#endif /*TELNET_H */
+15 -5
View File
@@ -855,6 +855,14 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
tty->master_suspended = (tty->smcr & TIOCM_CTS) ? 0 : 1;
telnet_rfc2217_ctl(tty->tn, TNS_CTL_CTSRTS);
}
else if (tio->c_iflag & (IXON | IXOFF))
{
tty->master_suspended = 0;
if (tio->c_iflag & IXON)
telnet_rfc2217_ctl(tty->tn, TNS_CTL_XONOFF_OUT);
if (tio->c_iflag & IXOFF)
telnet_rfc2217_ctl(tty->tn, TNS_CTL_XONOFF_IN);
}
else
{
tty->master_suspended = 0;
@@ -918,6 +926,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
case TCIFLUSH:
byte = 1;
tty->slave_suspended = 0; /* Re-enable polling of Slave */
tty->pollin = 0;
break;
case TCOFLUSH:
byte = 2;
@@ -927,6 +936,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
byte = 3;
tty->slave_suspended = 0; /* Re-enable polling of Slave */
tty->pollout = 1;
tty->pollin = 0;
break;
}
telnet_rfc2217_cfg(tty->tn, TNS_SET_PURGE, &byte, 1);
@@ -942,7 +952,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
break;
case TIOCMBIS:
CHECK_BUF_IN(sizeof(int));
tiocm = *(unsigned int *)in_buf;
tiocm = *(const unsigned int *)in_buf;
fuse_reply_ioctl(req, 0, 0, 0);
DBG("%s: cmd=%s tiocm=%#x\n", __func__, _ioctl_name(cmd), tiocm);
if (tiocm & TIOCM_RTS)
@@ -958,7 +968,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
goto show_mctl;
case TIOCMBIC:
CHECK_BUF_IN(sizeof(int));
tiocm = *(unsigned int *)in_buf;
tiocm = *(const unsigned int *)in_buf;
fuse_reply_ioctl(req, 0, 0, 0);
DBG("%s: cmd=%s tiocm=%#x\n", __func__, _ioctl_name(cmd), tiocm);
if (tiocm & TIOCM_RTS)
@@ -974,7 +984,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
goto show_mctl;
case TIOCMSET:
CHECK_BUF_IN(sizeof(int));
tiocm = *(unsigned int *)in_buf;
tiocm = *(const unsigned int *)in_buf;
fuse_reply_ioctl(req, 0, 0, 0);
DBG("%s: cmd=%s tiocm=%#x\n", __func__, _ioctl_name(cmd), tiocm);
tty->cmcr &= ~(TIOCM_RTS | TIOCM_DTR);
@@ -1004,7 +1014,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
break;
case TIOCSWINSZ:
CHECK_BUF_IN(sizeof(struct winsize));
ws = *(struct winsize *)in_buf;
ws = *(const struct winsize *)in_buf;
res = ioctl(tty->fds[FD_SLAVE].fd, TIOCSWINSZ, &ws);
if (res < 0)
{
@@ -1028,7 +1038,7 @@ ttynvt_ioctl(fuse_req_t req, int cmd, void *arg,
break;
case TIOCSETD:
CHECK_BUF_IN(sizeof(int));
val = *(int *)in_buf;
val = *(const int *)in_buf;
res = ioctl(tty->fds[FD_SLAVE].fd, TIOCSETD, &val);
if (res < 0)
fuse_reply_err(req, errno);