1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 03:22:48 -05:00

Separate backend_send from backend_sendbuffer.

On a similar theme of separating the query operation from the
attempted change, backend_send() now no longer has the side effect of
returning the current size of the send buffer. Instead, you have to
call backend_sendbuffer() every time you want to know that.
This commit is contained in:
Simon Tatham
2021-09-12 09:52:46 +01:00
parent 82177956da
commit c336643576
15 changed files with 44 additions and 49 deletions

View File

@ -1367,17 +1367,15 @@ static void pty_try_write(Pty *pty)
/*
* Called to send data down the pty.
*/
static size_t pty_send(Backend *be, const char *buf, size_t len)
static void pty_send(Backend *be, const char *buf, size_t len)
{
Pty *pty = container_of(be, Pty, backend);
if (pty->master_i < 0 || pty->pending_eof)
return 0; /* ignore all writes if fd closed */
return; /* ignore all writes if fd closed */
bufchain_add(&pty->output_data, buf, len);
pty_try_write(pty);
return bufchain_size(&pty->output_data);
}
static void pty_close(Pty *pty)

View File

@ -461,17 +461,15 @@ static void serial_try_write(Serial *serial)
/*
* Called to send data down the serial connection.
*/
static size_t serial_send(Backend *be, const char *buf, size_t len)
static void serial_send(Backend *be, const char *buf, size_t len)
{
Serial *serial = container_of(be, Serial, backend);
if (serial->fd < 0)
return 0;
return;
bufchain_add(&serial->output_data, buf, len);
serial_try_write(serial);
return bufchain_size(&serial->output_data);
}
/*