mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Completely remove sk_flush().
I've only just noticed that it doesn't do anything at all! Almost every implementation of the Socket vtable provides a flush() method which does nothing, optionally with a comment explaining why it's OK to do nothing. The sole exception is the wrapper Proxy_Socket, which implements the method during its setup phase by setting a pending_flush flag, so that when its sub-socket is later created, it can call sk_flush on that. But since the sub-socket's sk_flush will do nothing, even that is completely pointless! Source control history says that sk_flush was introduced by Dave Hinton in 2001 (commit7b0e08270
), who was going to use it for some purpose involving the SSL Telnet support he was working on at the time. That SSL support was never finished, and its vestigial declarations in network.h were removed in 2015 (commit42334b65b
). So sk_flush is just another vestige of that abandoned work, which I should have removed in the latter commit but overlooked.
This commit is contained in:
@ -229,12 +229,6 @@ static void fdsocket_write_eof(Socket *s)
|
||||
fdsocket_try_send(fds);
|
||||
}
|
||||
|
||||
static void fdsocket_flush(Socket *s)
|
||||
{
|
||||
/* FdSocket *fds = container_of(s, FdSocket, sock); */
|
||||
/* do nothing */
|
||||
}
|
||||
|
||||
static void fdsocket_set_frozen(Socket *s, bool is_frozen)
|
||||
{
|
||||
FdSocket *fds = container_of(s, FdSocket, sock);
|
||||
@ -315,7 +309,6 @@ static const SocketVtable FdSocket_sockvt = {
|
||||
fdsocket_write,
|
||||
fdsocket_write_oob,
|
||||
fdsocket_write_eof,
|
||||
fdsocket_flush,
|
||||
fdsocket_set_frozen,
|
||||
fdsocket_socket_error,
|
||||
NULL, /* peer_info */
|
||||
|
@ -492,14 +492,6 @@ static Plug *sk_net_plug(Socket *sock, Plug *p)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void sk_net_flush(Socket *s)
|
||||
{
|
||||
/*
|
||||
* We send data to the socket as soon as we can anyway,
|
||||
* so we don't need to do anything here. :-)
|
||||
*/
|
||||
}
|
||||
|
||||
static void sk_net_close(Socket *s);
|
||||
static size_t sk_net_write(Socket *s, const void *data, size_t len);
|
||||
static size_t sk_net_write_oob(Socket *s, const void *data, size_t len);
|
||||
@ -514,7 +506,6 @@ static struct SocketVtable NetSocket_sockvt = {
|
||||
sk_net_write,
|
||||
sk_net_write_oob,
|
||||
sk_net_write_eof,
|
||||
sk_net_flush,
|
||||
sk_net_set_frozen,
|
||||
sk_net_socket_error,
|
||||
sk_net_peer_info,
|
||||
|
Reference in New Issue
Block a user