# HG changeset patch # User Mikael Hallendal # Date 1213973082 -7200 # Node ID 4f24f7775c47230f7880d580376967ff93f824c1 # Parent d355b566f1412e516d0f22200ee7e6a6004ee060 Changed so that normal XMPP "pings" are always sent when keep alive is enabled. The change to disable the periodic sending of spaces in order to ensure traffic over the socket made the LM clients disconnect periodically with specific gateways. The implementation looks correct but it might be the firewall software that is not handling it correctly. This commit reverts the behaviour to always send the spaces even if the platform supports the TCP keep alive settings. diff -r d355b566f141 -r 4f24f7775c47 loudmouth/lm-connection.c --- a/loudmouth/lm-connection.c Fri Jun 20 16:42:26 2008 +0200 +++ b/loudmouth/lm-connection.c Fri Jun 20 16:44:42 2008 +0200 @@ -358,11 +358,15 @@ static void connection_start_keep_alive (LmConnection *connection) { - /* try using TCP keepalives if possible */ - if ((connection->keep_alive_rate > 0) && - lm_socket_set_keepalive (connection->socket, - connection->keep_alive_rate)) { - return; + /* try using TCP keepalives if possible */ + if ((connection->keep_alive_rate > 0) && + lm_socket_set_keepalive (connection->socket, + connection->keep_alive_rate)) { +#ifdef ONLY_TCP_KEEP_ALIVE + /* Many NAT firewalls seems to not handle this correctly and + * will disconnect the clients */ + return; +#endif /* ONLY_TCP_KEEP_ALIVE */ } if (connection->keep_alive_source) {