changeset 23504:5c95339855b2

Allow forcing an MSN HTTP connection to connect to a new server. This is important for initial connections that receive an XFR for the NS, since it seems that happens all the time now. Fixes #6107.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Mon, 23 Jun 2008 04:10:46 +0000
parents 165546763e3a
children efa4534fd23a
files libpurple/protocols/msn/notification.c libpurple/protocols/msn/servconn.c libpurple/protocols/msn/servconn.h libpurple/protocols/msn/switchboard.c
diffstat 4 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/notification.c	Mon Jun 23 01:14:02 2008 +0000
+++ b/libpurple/protocols/msn/notification.c	Mon Jun 23 04:10:46 2008 +0000
@@ -132,7 +132,7 @@
 	servconn = notification->servconn;
 
 	msn_servconn_set_connect_cb(servconn, connect_cb);
-	notification->in_use = msn_servconn_connect(servconn, host, port);
+	notification->in_use = msn_servconn_connect(servconn, host, port, TRUE);
 
 	return notification->in_use;
 }
--- a/libpurple/protocols/msn/servconn.c	Mon Jun 23 01:14:02 2008 +0000
+++ b/libpurple/protocols/msn/servconn.c	Mon Jun 23 04:10:46 2008 +0000
@@ -203,7 +203,7 @@
 }
 
 gboolean
-msn_servconn_connect(MsnServConn *servconn, const char *host, int port)
+msn_servconn_connect(MsnServConn *servconn, const char *host, int port, gboolean force)
 {
 	MsnSession *session;
 
@@ -223,7 +223,7 @@
 	{
 		/* HTTP Connection. */
 
-		if (!servconn->httpconn->connected)
+		if (!servconn->httpconn->connected || force)
 			if (!msn_httpconn_connect(servconn->httpconn, host, port))
 				return FALSE;
 
--- a/libpurple/protocols/msn/servconn.h	Mon Jun 23 01:14:02 2008 +0000
+++ b/libpurple/protocols/msn/servconn.h	Mon Jun 23 04:10:46 2008 +0000
@@ -115,8 +115,10 @@
  * @param servconn The connection.
  * @param host The host.
  * @param port The port.
+ * @param force Force this servconn to connect to a new server.
  */
-gboolean msn_servconn_connect(MsnServConn *servconn, const char *host, int port);
+gboolean msn_servconn_connect(MsnServConn *servconn, const char *host, int port,
+                              gboolean force);
 
 /**
  * Disconnects.
--- a/libpurple/protocols/msn/switchboard.c	Mon Jun 23 01:14:02 2008 +0000
+++ b/libpurple/protocols/msn/switchboard.c	Mon Jun 23 04:10:46 2008 +0000
@@ -1082,7 +1082,7 @@
 	msn_servconn_set_connect_cb(swboard->servconn, connect_cb);
 	msn_servconn_set_disconnect_cb(swboard->servconn, disconnect_cb);
 
-	return msn_servconn_connect(swboard->servconn, host, port);
+	return msn_servconn_connect(swboard->servconn, host, port, FALSE);
 }
 
 void