mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12: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:
@ -158,8 +158,7 @@ static void fdsocket_error_callback(void *vs)
|
||||
/*
|
||||
* An error has occurred on this socket. Pass it to the plug.
|
||||
*/
|
||||
plug_closing(fds->plug, strerror(fds->pending_error),
|
||||
fds->pending_error, 0);
|
||||
plug_closing(fds->plug, strerror(fds->pending_error), fds->pending_error);
|
||||
}
|
||||
|
||||
static int fdsocket_try_send(FdSocket *fds)
|
||||
@ -271,9 +270,9 @@ static void fdsocket_select_result_input(int fd, int event)
|
||||
fds->infd = -1;
|
||||
|
||||
if (retd < 0) {
|
||||
plug_closing(fds->plug, strerror(errno), errno, 0);
|
||||
plug_closing(fds->plug, strerror(errno), errno);
|
||||
} else {
|
||||
plug_closing(fds->plug, NULL, 0, 0);
|
||||
plug_closing(fds->plug, NULL, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user