diff options
author | Elliott Sales de Andrade <qulogic@pidgin.im> | 2010-05-21 07:36:59 +0000 |
---|---|---|
committer | Elliott Sales de Andrade <qulogic@pidgin.im> | 2010-05-21 07:36:59 +0000 |
commit | 11f16d83a61f48f0981f64a6be9bc788c7ca8cef (patch) | |
tree | b5683cfb7f9bff06671da64027414b9c7c0579c5 | |
parent | 7874c72e92cad9a5464809e1bceb4960431eb47a (diff) | |
download | pidgin-11f16d83a61f48f0981f64a6be9bc788c7ca8cef.tar.gz |
Make it more explicit that incoming and outgoing timeouts are different.
-rw-r--r-- | libpurple/protocols/msn/directconn.c | 10 | ||||
-rw-r--r-- | libpurple/protocols/msn/directconn.h | 8 | ||||
-rw-r--r-- | libpurple/protocols/msn/slp.c | 2 |
3 files changed, 12 insertions, 8 deletions
diff --git a/libpurple/protocols/msn/directconn.c b/libpurple/protocols/msn/directconn.c index c7d2fe1cab..b893055da2 100644 --- a/libpurple/protocols/msn/directconn.c +++ b/libpurple/protocols/msn/directconn.c @@ -791,7 +791,7 @@ msn_dc_connected_to_peer_cb(gpointer data, gint fd, const gchar *error_msg) /* * 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 @@ msn_dc_incoming_connection_timeout_cb(gpointer data) { /* * 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 @@ msn_dc_outgoing_connection_timeout_cb(gpointer data) 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 @@ msn_dc_outgoing_connection_timeout_cb(gpointer data) /* * 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 @@ msn_dc_listen_socket_created_cb(int listenfd, gpointer data) 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 --git a/libpurple/protocols/msn/directconn.h b/libpurple/protocols/msn/directconn.h index f68dcfd099..7c867279f1 100644 --- a/libpurple/protocols/msn/directconn.h +++ b/libpurple/protocols/msn/directconn.h @@ -114,8 +114,12 @@ struct _MsnDirectConn //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 --git a/libpurple/protocols/msn/slp.c b/libpurple/protocols/msn/slp.c index 1c9e7fe28e..122afff09d 100644 --- a/libpurple/protocols/msn/slp.c +++ b/libpurple/protocols/msn/slp.c @@ -424,7 +424,7 @@ msn_slp_process_transresp(MsnSlpCall *slpcall, const char *content) 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 ); |