Fixed the keep alive rate when using TCP for handling keep alive. Fixes LM-121.
authorMikael Hallendal <micke@imendio.com>
Mon, 25 Feb 2008 22:52:41 +0100
changeset 341 f44b206faf54
parent 340 ce4dcda8797c
child 342 ea543fec7afd
Fixed the keep alive rate when using TCP for handling keep alive. Fixes LM-121. The keep alive rate was multiplied with 1000 to fit into g_timeout_add. Moved it so that the multiplication is done when calling g_time_add instead.
loudmouth/lm-connection.c
--- a/loudmouth/lm-connection.c	Mon Feb 25 21:35:29 2008 +0100
+++ b/loudmouth/lm-connection.c	Mon Feb 25 22:52:41 2008 +0100
@@ -354,7 +354,7 @@
 	if (connection->keep_alive_rate > 0) {
 		connection->keep_alive_source =
 			lm_misc_add_timeout (connection->context,
-					     connection->keep_alive_rate,
+					     connection->keep_alive_rate * 1000,
 					     (GSourceFunc) connection_send_keep_alive,
 					     connection);
 	}
@@ -1559,7 +1559,7 @@
 		return;
 	}
 
-	connection->keep_alive_rate = rate * 1000;
+	connection->keep_alive_rate = rate;
 	
 	if (lm_connection_is_open (connection)) {
 		connection_start_keep_alive (connection);