mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Backends: notify ldisc when sendok becomes true. (NFC)
I've introduced a function ldisc_notify_sendok(), which backends should call on their ldisc (if they have one) when anything changes that might cause backend_sendok() to start returning true. At the moment, the function does nothing. But in future, I'm going to make ldisc start buffering typed-ahead input data not yet sent to the backend, and then the effect of this function will be to trigger flushing all that data into the backend. Backends only have to call this function if sendok was previously false: backends requiring no network connection stage (like pty and serial) can safely return true from sendok, and in that case, they don't also have to immediately call this function.
This commit is contained in:
@ -17,6 +17,7 @@ struct Raw {
|
||||
size_t bufsize;
|
||||
Seat *seat;
|
||||
LogContext *logctx;
|
||||
Ldisc *ldisc;
|
||||
bool sent_console_eof, sent_socket_eof, socket_connected;
|
||||
|
||||
Conf *conf;
|
||||
@ -41,6 +42,8 @@ static void raw_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
error_code, raw->conf, raw->socket_connected);
|
||||
if (type == PLUGLOG_CONNECT_SUCCESS) {
|
||||
raw->socket_connected = true;
|
||||
if (raw->ldisc)
|
||||
ldisc_check_sendok(raw->ldisc);
|
||||
if (is_tempseat(raw->seat)) {
|
||||
Seat *ts = raw->seat;
|
||||
tempseat_flush(ts);
|
||||
@ -295,7 +298,8 @@ static bool raw_ldisc(Backend *be, int option)
|
||||
|
||||
static void raw_provide_ldisc(Backend *be, Ldisc *ldisc)
|
||||
{
|
||||
/* This is a stub. */
|
||||
Raw *raw = container_of(be, Raw, backend);
|
||||
raw->ldisc = ldisc;
|
||||
}
|
||||
|
||||
static int raw_exitcode(Backend *be)
|
||||
|
Reference in New Issue
Block a user