mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-02 20:12: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:
@ -71,6 +71,7 @@ struct supdup_tag
|
||||
|
||||
Seat *seat;
|
||||
LogContext *logctx;
|
||||
Ldisc *ldisc;
|
||||
int term_width, term_height;
|
||||
|
||||
long long ttyopt;
|
||||
@ -565,6 +566,8 @@ static void supdup_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
supdup->conf, supdup->socket_connected);
|
||||
if (type == PLUGLOG_CONNECT_SUCCESS) {
|
||||
supdup->socket_connected = true;
|
||||
if (supdup->ldisc)
|
||||
ldisc_check_sendok(supdup->ldisc);
|
||||
if (is_tempseat(supdup->seat)) {
|
||||
Seat *ts = supdup->seat;
|
||||
tempseat_flush(ts);
|
||||
@ -893,6 +896,8 @@ static bool supdup_ldisc(Backend *be, int option)
|
||||
|
||||
static void supdup_provide_ldisc(Backend *be, Ldisc *ldisc)
|
||||
{
|
||||
Supdup *supdup = container_of(be, Supdup, backend);
|
||||
supdup->ldisc = ldisc;
|
||||
}
|
||||
|
||||
static int supdup_exitcode(Backend *be)
|
||||
|
Reference in New Issue
Block a user