changeset 23530:e29019f78984

Use purple_url_parse for splitting up the MSN SOAP redirect instead of trying to figure it out ourselves (and doing it wrongly, I might add). Thanks again, Dimmuxx for spotting that.
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Tue, 17 Jun 2008 00:55:26 +0000
parents 46d8edad1647
children 3207561b0f17
files libpurple/protocols/msn/soap2.c
diffstat 1 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/soap2.c	Mon Jun 16 02:29:33 2008 +0000
+++ b/libpurple/protocols/msn/soap2.c	Tue Jun 17 00:55:26 2008 +0000
@@ -183,18 +183,10 @@
 static gboolean
 msn_soap_handle_redirect(MsnSoapConnection *conn, const char *url)
 {
-	char *c;
-
-	/* Skip the http:// */
-	if ((c = strchr(url, '/')) != NULL)
-		url += 2;
+	char *host;
+	char *path;
 
-	if ((c = strchr(url, '/')) != NULL) {
-		char *host, *path;
-
-		host = g_strndup(url, c - url);
-		path = g_strdup(c);
-
+	if (purple_url_parse(url, &host, NULL, &path, NULL, NULL)) {
 		msn_soap_message_send_internal(conn->session,
 			conn->current_request->message,	host, path,
 			conn->current_request->cb, conn->current_request->cb_data, TRUE);