From f409a5e841d91237fe4034818955dd88167a679b Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 15 Jul 2013 19:06:35 +0000 Subject: add a global tcp-keepalive-option. thanks to Fefe --- vchat-protocol.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'vchat-protocol.c') diff --git a/vchat-protocol.c b/vchat-protocol.c index b9a5e15..b50f511 100755 --- a/vchat-protocol.c +++ b/vchat-protocol.c @@ -92,6 +92,11 @@ static int connect_socket( char *server, char *port ) { break; /* okay we got one */ } freeaddrinfo(res0); + + if (want_tcp_keepalive) { /* global from vchat-client.c */ + int one=1; + setsockopt(s,SOL_SOCKET,SO_KEEPALIVE,&one,sizeof(one)); + } return s; } @@ -373,7 +378,7 @@ justloggedin (char *message) /* we're not logged in, change status and request nicks */ if (!loggedin) { - loadcfg(getstroption(CF_LOGINSCRIPT),handleline); + loadcfg(getstroption(CF_LOGINSCRIPT),0,handleline); handleline(".S"); loggedin = 1; } -- cgit v1.2.3