1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00
putty-source/unix
Simon Tatham bc91a39670 Proper buffer management between terminal and backend.
The return value of term_data() is used as the return value from the
GUI-terminal versions of the Seat output method, which means backends
will take it to be the amount of standard-output data currently
buffered, and exert back-pressure on the remote peer if it gets too
big (e.g. by ceasing to extend the window in that particular SSH-2
channel).

Historically, as a comment in term_data() explained, we always just
returned 0 from that function, on the basis that we were processing
all the terminal data through our terminal emulation code immediately,
and never retained any of it in the buffer at all. If the terminal
emulation code were to start running slowly, then it would slow down
the _whole_ PuTTY system, due to single-threadedness, and
back-pressure of a sort would be exerted on the remote by it simply
failing to get round to reading from the network socket. But by the
time we got back to the top level of term_data(), we'd have finished
reading all the data we had, so it was still appropriate to return 0.

That comment is still correct if you're thinking about the limiting
factor on terminal data processing being the CPU usage in term_out().
But now that's no longer the whole story, because sometimes we leave
data in term->inbuf without having processed it: during drag-selects
in the terminal window, and (just introduced) while waiting for the
response to a pending window resize request. For both those reasons,
we _don't_ always have a buffer size of zero when we return from
term_data().

So now that hole in our buffer size management is filled in:
term_data() returns the true size of the remaining unprocessed
terminal output, so that back-pressure will be exerted if the terminal
is currently not consuming it. And when processing resumes and we
start to clear our backlog, we call backend_unthrottle to let the
backend know it can relax the back-pressure if necessary.
2021-12-19 11:02:48 +00:00
..
utils Break up gtkmisc.c. 2021-04-26 18:00:01 +01:00
agent-client.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
agent-socket.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
askpass.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
cliloop.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
CMakeLists.txt Fix pre-GTK3 build failures in puttyapp / ptermapp. 2021-12-18 11:43:57 +00:00
columns.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
columns.h Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
config-gtk.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
config-unix.c Initial support for in-process proxy SSH connections. 2021-05-22 14:13:52 +01:00
console.c New Seat query, has_mixed_input_stream(). 2021-11-06 14:48:26 +00:00
dialog.c Generalise strbuf_catf() into put_fmt(). 2021-11-19 11:32:47 +00:00
fd-socket.c Convenience wrappers on plug_closing(). 2021-11-06 14:48:26 +00:00
gss.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
gtk-common.c Move STR() and CAT() into defs.h. 2021-11-26 17:46:06 +00:00
gtkcompat.h gtkcompat.h: fix GTK1 implementation of ref_sink. 2019-11-02 08:26:14 +00:00
gtkmisc.h Convert a lot of 'int' variables to 'bool'. 2018-11-03 13:45:00 +00:00
keygen-noise.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
local-proxy.c Support interactive password prompts in Telnet proxy. 2021-11-19 18:33:51 +00:00
main-gtk-application.c Fix pre-GTK3 build failures in puttyapp / ptermapp. 2021-12-18 11:43:57 +00:00
main-gtk-simple.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
network.c Generalise strbuf_catf() into put_fmt(). 2021-11-19 11:32:47 +00:00
no-gtk.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
noise.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
osxlaunch.c osxlaunch: stop setting DYLD_LIBRARY_PATH. 2017-12-20 10:04:02 +00:00
pageant.c Merge be_*.c into one ifdef-controlled module. 2021-11-26 17:58:55 +00:00
peerinfo.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
platform.h Convenience wrappers on plug_closing(). 2021-11-06 14:48:26 +00:00
plink.c Marshalling macros put_dataz and put_datalit. 2021-11-19 15:09:17 +00:00
printing.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
procnet.c Generalise strbuf_catf() into put_fmt(). 2021-11-19 11:32:47 +00:00
psocks.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
psusan.c Merge be_*.c into one ifdef-controlled module. 2021-11-26 17:58:55 +00:00
pterm-config-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
pterm-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
pterm.bundle OS X makefile: stop depending on JHBUILD_PREFIX. 2017-11-26 11:45:48 +00:00
pterm.c Merge be_*.c into one ifdef-controlled module. 2021-11-26 17:58:55 +00:00
pterm.plist Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
pty.c Add memsets after allocation of all Backend implementors. 2021-10-30 17:28:28 +01:00
putty-config-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
putty-xpm.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
putty.bundle OS X makefile: stop depending on JHBUILD_PREFIX. 2017-11-26 11:45:48 +00:00
putty.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
putty.plist Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
serial.c Add memsets after allocation of all Backend implementors. 2021-10-30 17:28:28 +01:00
sftp.c Complete rework of terminal userpass input system. 2021-09-14 13:19:33 +01:00
sftpserver.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
sharing.c Pass an Interactor to new_connection(). 2021-10-30 18:19:56 +01:00
storage.c Marshalling macros put_dataz and put_datalit. 2021-11-19 15:09:17 +00:00
unicode.c Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
unifont.c Generalise strbuf_catf() into put_fmt(). 2021-11-19 11:32:47 +00:00
unifont.h Rename most of the platform source files. 2021-04-26 18:00:01 +01:00
uppity.c Merge be_*.c into one ifdef-controlled module. 2021-11-26 17:58:55 +00:00
uxsel.c Whitespace rationalisation of entire code base. 2019-09-08 20:29:21 +01:00
window.c Proper buffer management between terminal and backend. 2021-12-19 11:02:48 +00:00
x11.c Unix platform_make_x11_server: fix sense of error check. 2021-09-10 10:38:30 +01:00
x11misc.h Basic support for running under GDK Wayland back end. 2018-05-09 09:21:27 +01:00