1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-05 21:42:47 -05:00

Revamp of EOF handling in all network connections, pipes and other

data channels. Should comprehensively fix 'half-closed', in principle,
though it's a big and complicated change and so there's a good chance
I've made at least one mistake somewhere.

All connections should now be rigorous about propagating end-of-file
(or end-of-data-stream, or socket shutdown, or whatever) independently
in both directions, except in frontends with no mechanism for sending
explicit EOF (e.g. interactive terminal windows) or backends which are
basically always used for interactive sessions so it's unlikely that
an application would be depending on independent EOF (telnet, rlogin).

EOF should now never accidentally be sent while there's still buffered
data to go out before it. (May help fix 'portfwd-corrupt', and also I
noticed recently that the ssh main session channel can accidentally
have MSG_EOF sent before the output bufchain is clear, leading to
embarrassment when it subsequently does send the output).

[originally from svn r9279]
This commit is contained in:
Simon Tatham
2011-09-13 11:44:03 +00:00
parent c68a646c64
commit 947962e0b9
23 changed files with 616 additions and 237 deletions

4
ssh.h
View File

@ -9,8 +9,8 @@
struct ssh_channel;
extern void sshfwd_close(struct ssh_channel *c);
extern int sshfwd_write(struct ssh_channel *c, char *, int);
extern void sshfwd_write_eof(struct ssh_channel *c);
extern void sshfwd_unthrottle(struct ssh_channel *c, int bufsize);
/*
@ -342,6 +342,7 @@ extern const char *pfd_addforward(char *desthost, int destport, char *srcaddr,
extern void pfd_close(Socket s);
extern void pfd_terminate(void *sockdata);
extern int pfd_send(Socket s, char *data, int len);
extern void pfd_send_eof(Socket s);
extern void pfd_confirm(Socket s);
extern void pfd_unthrottle(Socket s);
extern void pfd_override_throttle(Socket s, int enable);
@ -397,6 +398,7 @@ extern const char *x11_init(Socket *, struct X11Display *, void *,
const char *, int, Conf *);
extern void x11_close(Socket);
extern int x11_send(Socket, char *, int);
extern void x11_send_eof(Socket s);
extern void x11_unthrottle(Socket s);
extern void x11_override_throttle(Socket s, int enable);
char *x11_display(const char *display);