mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
6246ff3f0a
This is used to notify the Seat that some data has been cleared from the backend's outgoing data buffer. In other words, it notifies the Seat that it might be worth calling backend_sendbuffer() again. We've never needed this before, because until now, Seats have always been the 'main program' part of the application, meaning they were also in control of the event loop. So they've been able to call backend_sendbuffer() proactively, every time they go round the event loop, instead of having to wait for a callback. But now, the SSH proxy is the first example of a Seat without privileged access to the event loop, so it has no way to find out that the backend's sendbuffer has got smaller. And without that, it can't pass that notification on to plug_sent, to unblock in turn whatever the proxied connection might have been waiting to send. In fact, before this commit, sshproxy.c never called plug_sent at all. As a result, large data uploads over an SSH jump host would hang forever as soon as the outgoing buffer filled up for the first time: the main backend (to which sshproxy.c was acting as a Socket) would carefully stop filling up the buffer, and then never receive the call to plug_sent that would cause it to start again. The new callback is ignored everywhere except in sshproxy.c. It might be a good idea to remove backend_sendbuffer() entirely and convert all previous uses of it into non-empty implementations of this callback, so that we've only got one system; but for the moment, I haven't done that.
45 lines
2.2 KiB
C
45 lines
2.2 KiB
C
/*
|
|
* Stub methods usable by Seat implementations.
|
|
*/
|
|
|
|
#include "putty.h"
|
|
|
|
size_t nullseat_output(
|
|
Seat *seat, bool is_stderr, const void *data, size_t len) { return 0; }
|
|
bool nullseat_eof(Seat *seat) { return true; }
|
|
void nullseat_sent(Seat *seat, size_t bufsize) {}
|
|
int nullseat_get_userpass_input(
|
|
Seat *seat, prompts_t *p, bufchain *input) { return 0; }
|
|
void nullseat_notify_remote_exit(Seat *seat) {}
|
|
void nullseat_notify_remote_disconnect(Seat *seat) {}
|
|
void nullseat_connection_fatal(Seat *seat, const char *message) {}
|
|
void nullseat_update_specials_menu(Seat *seat) {}
|
|
char *nullseat_get_ttymode(Seat *seat, const char *mode) { return NULL; }
|
|
void nullseat_set_busy_status(Seat *seat, BusyStatus status) {}
|
|
int nullseat_verify_ssh_host_key(
|
|
Seat *seat, const char *host, int port, const char *keytype,
|
|
char *keystr, const char *keydisp, char **key_fingerprints,
|
|
void (*callback)(void *ctx, int result), void *ctx) { return 0; }
|
|
int nullseat_confirm_weak_crypto_primitive(
|
|
Seat *seat, const char *algtype, const char *algname,
|
|
void (*callback)(void *ctx, int result), void *ctx) { return 0; }
|
|
int nullseat_confirm_weak_cached_hostkey(
|
|
Seat *seat, const char *algname, const char *betteralgs,
|
|
void (*callback)(void *ctx, int result), void *ctx) { return 0; }
|
|
bool nullseat_is_never_utf8(Seat *seat) { return false; }
|
|
bool nullseat_is_always_utf8(Seat *seat) { return true; }
|
|
void nullseat_echoedit_update(Seat *seat, bool echoing, bool editing) {}
|
|
const char *nullseat_get_x_display(Seat *seat) { return NULL; }
|
|
bool nullseat_get_windowid(Seat *seat, long *id_out) { return false; }
|
|
bool nullseat_get_window_pixel_size(
|
|
Seat *seat, int *width, int *height) { return false; }
|
|
StripCtrlChars *nullseat_stripctrl_new(
|
|
Seat *seat, BinarySink *bs_out, SeatInteractionContext sic) {return NULL;}
|
|
bool nullseat_set_trust_status(Seat *seat, bool tr) { return false; }
|
|
bool nullseat_set_trust_status_vacuously(Seat *seat, bool tr) { return true; }
|
|
bool nullseat_verbose_no(Seat *seat) { return false; }
|
|
bool nullseat_verbose_yes(Seat *seat) { return true; }
|
|
bool nullseat_interactive_no(Seat *seat) { return false; }
|
|
bool nullseat_interactive_yes(Seat *seat) { return true; }
|
|
bool nullseat_get_cursor_position(Seat *seat, int *x, int *y) { return false; }
|