On Thursday 22 January 2009 07:20, Doug Graham wrote:
> Hello,
>
> Busybox's telnetd does not disable local (client-side) flow control
> properly. It does not put the pty into packet mode and then notify the
> client whenever flow control is disabled by an application running under
> its control.
I'm confused. Are you talking about the case when application prints ^S?
What should happen then? We should send corresponding telnet sequence
to the network peer?
If my understanding above is correct, then it looks like
you are not using correct bits:
Docs say:
TIOCPKT Enable/disable packet mode. When applied to the master side of
a pseudo terminal, each
subsequent read(2) from the terminal will return data written on the slave part
of the pseudo terminal preceded by a
zero byte (symbolically defined as TIOCPKT_DATA), or a single byte reflecting
control status information.
In the latter case, the byte is an inclusive-or of zero or more of the bits:
TIOCPKT_FLUSHREAD whenever the read queue for the terminal is flushed.
TIOCPKT_FLUSHWRITE whenever the write queue for the terminal is flushed.
TIOCPKT_STOP whenever output to the terminal is stopped a la ^S.
TIOCPKT_START whenever output to the terminal is restarted.
TIOCPKT_DOSTOP whenever t_stopc is ^S and t_startc is ^Q.
TIOCPKT_NOSTOP whenever the start and stop characters are not ^S/^Q.
The code is:
+ control = TS_BUF2[ts->rdidx2];
...
+ if ((control & (TIOCPKT_DOSTOP|TIOCPKT_NOSTOP)) != 0
+ && ts->flowstate != (control & TIOCPKT_DOSTOP)) {
Shouldn't you check for TIOCPKT_STOP, not TIOCPKT_DOSTOP?
> The result is that ^S/^Q are not passed through to the
> application,
Huh? ^S/^Q are coming FROM application, right? Or are you talking
about different case here?
> which is painful when the application is an emacs variant.
>
> I suppose that support for this might be considered bloat, but the
> included patch only adds about 200 bytes of text to x86 busybox and 300
> bytes to mipsel busybox. Please consider applying.
I want to, but first I want to understand better what we do here,
and I'd also like to reproduce the problem(s).
What do I need to do to see the problem?
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox