mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 19:12:48 -05:00
Add a configuration option for TCP keepalives (SO_KEEPALIVE), default off.
No very good reason, but I've occasionally wanted to frob it to see if it makes any difference to problems I'm having, and it was easy. Tested that it does actually cause keepalives on Windows (with tcpdump); should also work on Unix. Not implemented on Mac (does nothing), but then neither is TCP_NODELAY. Quite a big checkin, much of which is adding `keepalive' alongside `nodelay' in network function calls. [originally from svn r4309]
This commit is contained in:
4
telnet.c
4
telnet.c
@ -674,7 +674,7 @@ static void telnet_sent(Plug plug, int bufsize)
|
||||
static const char *telnet_init(void *frontend_handle, void **backend_handle,
|
||||
Config *cfg,
|
||||
char *host, int port, char **realhost,
|
||||
int nodelay)
|
||||
int nodelay, int keepalive)
|
||||
{
|
||||
static const struct plug_function_table fn_table = {
|
||||
telnet_closing,
|
||||
@ -729,7 +729,7 @@ static const char *telnet_init(void *frontend_handle, void **backend_handle,
|
||||
sfree(buf);
|
||||
}
|
||||
telnet->s = new_connection(addr, *realhost, port, 0, 1,
|
||||
nodelay, (Plug) telnet, &telnet->cfg);
|
||||
nodelay, keepalive, (Plug) telnet, &telnet->cfg);
|
||||
if ((err = sk_socket_error(telnet->s)) != NULL)
|
||||
return err;
|
||||
|
||||
|
Reference in New Issue
Block a user