changeset 30498:794001c22306

Can now sucessfully request relay info through HTTP Does not yet actually use it...
author Marcus Lundblad <ml@update.uu.se>
date Tue, 22 Sep 2009 22:42:21 +0000
parents bdc353e65a76
children f858b53dfbf0
files libpurple/protocols/jabber/google.c
diffstat 1 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Mon Sep 21 21:28:55 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Tue Sep 22 22:42:21 2009 +0000
@@ -391,7 +391,6 @@
 		purple_media_error(session->media, "Error adding stream.");
 		purple_media_end(session->media, NULL, NULL);
 		g_free(params);
-		return FALSE;
 	}
 
 	g_free(params);	
@@ -438,15 +437,18 @@
 	/* if we got a relay token and relay host in google:jingleinfo, issue an
 	 HTTP request to get that data */
 	if (js->google_relay_host && js->google_relay_token) {
-		const gchar *url = 
-			g_strdup_printf("http://%s/create_session", js->google_relay_host);
-		const gchar *request =
-			g_strdup_printf("GET /create_session HTTP 1.1\r\n"
+		gchar *url = 
+			g_strdup_printf("http://%s", js->google_relay_host);
+		gchar *request =
+			g_strdup_printf("GET /create_session HTTP/1.0\r\n"
+			                "Host: %s\r\n"
 							"X-Talk-Google-Relay-Auth: %s\r\n"
-							"X-Google-Relay-Auth: %s\r\n", 
-				js->google_relay_token, js->google_relay_token);
+							"X-Google-Relay-Auth: %s\r\n\r\n", 
+				js->google_relay_host, js->google_relay_token, js->google_relay_token);
+		purple_debug_info("jabber", 
+			"sending Google relay request %s to %s\n", request, url); 
 		js->google_relay_request =
-			purple_util_fetch_url_request(url, TRUE, NULL, TRUE, request, FALSE,
+			purple_util_fetch_url_request(url, FALSE, NULL, FALSE, request, FALSE,
 				jabber_google_relay_response_cb, session);
 		g_free(url);
 		g_free(request);
@@ -1431,8 +1433,8 @@
 	}
 
 	if (relay) {
-		const xmlnode *token = xmlnode_get_child(relay, "token");
-		const xmlnode *server = xmlnode_get_child(relay, "server");
+		xmlnode *token = xmlnode_get_child(relay, "token");
+		xmlnode *server = xmlnode_get_child(relay, "server");
 		
 		if (token) {
 			gchar *relay_token = xmlnode_get_data(token);