changeset 30499:1aa1e1e1876d

Make it more explicit that incoming and outgoing timeouts are different.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Fri, 21 May 2010 07:36:59 +0000
parents 3c4f821de25b
children 3dac28d77320
files libpurple/protocols/msn/directconn.c libpurple/protocols/msn/directconn.h libpurple/protocols/msn/slp.c
diffstat 3 files changed, 12 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/directconn.c	Fri May 21 06:21:05 2010 +0000
+++ b/libpurple/protocols/msn/directconn.c	Fri May 21 07:36:59 2010 +0000
@@ -791,7 +791,7 @@
 
 /*
  * This callback will be called when we're the server
- * and nobody has connected us in DC_CONNECT_TIMEOUT seconds
+ * and nobody has connected us in DC_INCOMING_TIMEOUT seconds
  */
 static gboolean
 msn_dc_incoming_connection_timeout_cb(gpointer data) {
@@ -829,7 +829,7 @@
 
 /*
  * This callback will be called when we're unable to connect to
- * the remote host in DC_CONNECT_TIMEOUT seconds.
+ * the remote host in DC_OUTGOING_TIMEOUT seconds.
  */
 gboolean
 msn_dc_outgoing_connection_timeout_cb(gpointer data)
@@ -863,7 +863,7 @@
 
 		if (dc->connect_data) {
 			dc->connect_timeout_handle = purple_timeout_add_seconds(
-				DC_CONNECT_TIMEOUT,
+				DC_OUTGOING_TIMEOUT,
 				msn_dc_outgoing_connection_timeout_cb,
 				dc
 			);
@@ -888,7 +888,7 @@
 
 /*
  * This callback will be called when we're the server
- * and somebody has connected to us in DC_CONNECT_TIMEOUT seconds.
+ * and somebody has connected to us in DC_INCOMING_TIMEOUT seconds.
  */
 static void
 msn_dc_incoming_connection_cb(gpointer data, gint listenfd, PurpleInputCondition cond)
@@ -951,7 +951,7 @@
 			dc
 		);
 		dc->connect_timeout_handle = purple_timeout_add_seconds(
-			DC_CONNECT_TIMEOUT * 2, /* Internal + external connection attempts */
+			DC_INCOMING_TIMEOUT,
 			msn_dc_incoming_connection_timeout_cb,
 			dc
 		);
--- a/libpurple/protocols/msn/directconn.h	Fri May 21 06:21:05 2010 +0000
+++ b/libpurple/protocols/msn/directconn.h	Fri May 21 07:36:59 2010 +0000
@@ -114,8 +114,12 @@
 	//int   num_calls;  /**< The number of slpcalls using this direct connection */
 };
 
-#define DC_CONNECT_TIMEOUT 	5
-#define DC_TIMEOUT 		60
+/* Outgoing attempt */
+#define DC_OUTGOING_TIMEOUT (5)
+/* Time for internal + external connection attempts */
+#define DC_INCOMING_TIMEOUT (DC_OUTGOING_TIMEOUT * 3)
+/* Timeout for lack of activity */
+#define DC_TIMEOUT          (60)
 
 /*
  * Queues an MSN message to be sent via direct connection.
--- a/libpurple/protocols/msn/slp.c	Fri May 21 06:21:05 2010 +0000
+++ b/libpurple/protocols/msn/slp.c	Fri May 21 07:36:59 2010 +0000
@@ -424,7 +424,7 @@
 				if (dc->connect_data) {
 					/* Add connect timeout handle */
 					dc->connect_timeout_handle = purple_timeout_add_seconds(
-						DC_CONNECT_TIMEOUT,
+						DC_OUTGOING_TIMEOUT,
 						msn_dc_outgoing_connection_timeout_cb,
 						dc
 					);