# HG changeset patch # User Elliott Sales de Andrade # Date 1274427419 0 # Node ID 1aa1e1e1876db834bfd39221f1b9bf222af35d6e # Parent 3c4f821de25b5fe178f22c6b1c5884f42d9408c8 Make it more explicit that incoming and outgoing timeouts are different. diff -r 3c4f821de25b -r 1aa1e1e1876d libpurple/protocols/msn/directconn.c --- 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 ); diff -r 3c4f821de25b -r 1aa1e1e1876d libpurple/protocols/msn/directconn.h --- 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. diff -r 3c4f821de25b -r 1aa1e1e1876d libpurple/protocols/msn/slp.c --- 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 );