mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-15 18:17:32 -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:
18
proxy.c
18
proxy.c
@ -57,11 +57,6 @@ void proxy_activate (ProxySocket *p)
|
||||
if (output_after < output_before)
|
||||
plug_sent(p->plug, output_after);
|
||||
|
||||
/* if we were asked to flush the output during
|
||||
* the proxy negotiation process, do so now.
|
||||
*/
|
||||
if (p->pending_flush) sk_flush(p->sub_socket);
|
||||
|
||||
/* if we have a pending EOF to send, send it */
|
||||
if (p->pending_eof) sk_write_eof(p->sub_socket);
|
||||
|
||||
@ -128,17 +123,6 @@ static void sk_proxy_write_eof (Socket *s)
|
||||
sk_write_eof(ps->sub_socket);
|
||||
}
|
||||
|
||||
static void sk_proxy_flush (Socket *s)
|
||||
{
|
||||
ProxySocket *ps = container_of(s, ProxySocket, sock);
|
||||
|
||||
if (ps->state != PROXY_STATE_ACTIVE) {
|
||||
ps->pending_flush = true;
|
||||
return;
|
||||
}
|
||||
sk_flush(ps->sub_socket);
|
||||
}
|
||||
|
||||
static void sk_proxy_set_frozen (Socket *s, bool is_frozen)
|
||||
{
|
||||
ProxySocket *ps = container_of(s, ProxySocket, sock);
|
||||
@ -393,7 +377,6 @@ static const struct SocketVtable ProxySocket_sockvt = {
|
||||
sk_proxy_write,
|
||||
sk_proxy_write_oob,
|
||||
sk_proxy_write_eof,
|
||||
sk_proxy_flush,
|
||||
sk_proxy_set_frozen,
|
||||
sk_proxy_socket_error,
|
||||
NULL, /* peer_info */
|
||||
@ -437,7 +420,6 @@ Socket *new_connection(SockAddr *addr, const char *hostname,
|
||||
ret->remote_port = port;
|
||||
|
||||
ret->error = NULL;
|
||||
ret->pending_flush = false;
|
||||
ret->pending_eof = false;
|
||||
ret->freeze = false;
|
||||
|
||||
|
Reference in New Issue
Block a user