mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-01 11:32:48 -05:00
Remove 'calling_back' parameter from plug_closing.
It was totally unused. No implementation of the 'closing' method in a
Plug vtable was checking it for any reason at all, except for
ProxySocket which captured it from its client in order to pass on to
its server (which, perhaps after further iterations of ProxySocket,
would have ended up ignoring it similarly). And every caller of
plug_closing set it to 0 (aka false), except for the one in sshproxy.c
which passed true (but it would have made no difference to anyone).
The comment in network.h refers to a FIXME comment which was in
try_send() when that code was written (see winnet.c in commit
7b0e082700
). That FIXME is long gone, replaced by a use of a
toplevel callback. So I think the aim must have been to avoid
re-entrancy when sk_write called try_send which encountered a socket
error and called back to plug_closing - but that's long since fixed by
other means now.
This commit is contained in:
@ -109,8 +109,7 @@ static void pfl_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
|
||||
static void pfd_close(struct PortForwarding *pf);
|
||||
|
||||
static void pfd_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void pfd_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{
|
||||
struct PortForwarding *pf =
|
||||
container_of(plug, struct PortForwarding, plug);
|
||||
@ -142,8 +141,7 @@ static void pfd_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
|
||||
static void pfl_terminate(struct PortListener *pl);
|
||||
|
||||
static void pfl_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void pfl_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{
|
||||
struct PortListener *pl = (struct PortListener *) plug;
|
||||
pfl_terminate(pl);
|
||||
|
@ -139,8 +139,7 @@ static void server_socket_log(Plug *plug, PlugLogType type, SockAddr *addr,
|
||||
/* FIXME */
|
||||
}
|
||||
|
||||
static void server_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void server_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{
|
||||
server *srv = container_of(plug, server, plug);
|
||||
if (error_msg) {
|
||||
|
@ -366,8 +366,7 @@ bool sesschan_run_subsystem(Channel *chan, ptrlen subsys)
|
||||
static void fwd_log(Plug *plug, PlugLogType type, SockAddr *addr, int port,
|
||||
const char *error_msg, int error_code)
|
||||
{ /* don't expect any weirdnesses from a listening socket */ }
|
||||
static void fwd_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void fwd_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{ /* not here, either */ }
|
||||
|
||||
static int xfwd_accepting(Plug *p, accept_fn_t constructor, accept_ctx_t ctx)
|
||||
|
@ -937,8 +937,7 @@ static void share_disconnect(struct ssh_sharing_connstate *cs,
|
||||
share_begin_cleanup(cs);
|
||||
}
|
||||
|
||||
static void share_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void share_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{
|
||||
struct ssh_sharing_connstate *cs = container_of(
|
||||
plug, struct ssh_sharing_connstate, plug);
|
||||
@ -1846,7 +1845,7 @@ static void share_sent(Plug *plug, size_t bufsize)
|
||||
}
|
||||
|
||||
static void share_listen_closing(Plug *plug, const char *error_msg,
|
||||
int error_code, bool calling_back)
|
||||
int error_code)
|
||||
{
|
||||
ssh_sharing_state *sharestate =
|
||||
container_of(plug, ssh_sharing_state, plug);
|
||||
|
@ -609,8 +609,7 @@ static void ssh_socket_log(Plug *plug, PlugLogType type, SockAddr *addr,
|
||||
}
|
||||
}
|
||||
|
||||
static void ssh_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void ssh_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{
|
||||
Ssh *ssh = container_of(plug, Ssh, plug);
|
||||
if (error_msg) {
|
||||
|
@ -267,8 +267,7 @@ static void x11_log(Plug *p, PlugLogType type, SockAddr *addr, int port,
|
||||
static void x11_send_init_error(struct X11Connection *conn,
|
||||
const char *err_message);
|
||||
|
||||
static void x11_closing(Plug *plug, const char *error_msg, int error_code,
|
||||
bool calling_back)
|
||||
static void x11_closing(Plug *plug, const char *error_msg, int error_code)
|
||||
{
|
||||
struct X11Connection *xconn = container_of(
|
||||
plug, struct X11Connection, plug);
|
||||
|
Reference in New Issue
Block a user