mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 12:32:47 -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:
@ -12,7 +12,7 @@ struct macnet_stack {
|
||||
void (*addrcopy)(SockAddr, char *);
|
||||
void (*addr_free)(SockAddr);
|
||||
Socket (*skregister)(void *, Plug); /* "register" is a reserved word */
|
||||
Socket (*new)(SockAddr, int, int, int, int, Plug);
|
||||
Socket (*new)(SockAddr, int, int, int, int, int, Plug);
|
||||
Socket (*newlistener)(char *, int, Plug, int);
|
||||
char *(*addr_error)(SockAddr);
|
||||
void (*poll)(void);
|
||||
@ -128,11 +128,12 @@ Socket sk_register(void *sock, Plug plug)
|
||||
}
|
||||
|
||||
Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
|
||||
int nodelay, Plug plug)
|
||||
int nodelay, int keepalive, Plug plug)
|
||||
{
|
||||
|
||||
if (stack != NULL)
|
||||
return stack->new(addr, port, privport, oobinline, nodelay, plug);
|
||||
return stack->new(addr, port, privport, oobinline, nodelay, keepalive,
|
||||
plug);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user