/soc/2013/ashmew2/filetransferX: 37e2393a80fc: Added ShareChanne...

Ashish Gupta ashmew2 at gmail.com
Sun Aug 18 07:53:45 EDT 2013


Changeset: 37e2393a80fc7012b8107978f1fe7b615bfa1cc5
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2013-08-17 03:21 +0530
Branch:	 filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/37e2393a80fc

Description:

Added ShareChannel struct

diffstat:

 libpurple/protocols/jabber/google/google_session.c |  37 +++++++++++++++++----
 1 files changed, 29 insertions(+), 8 deletions(-)

diffs (88 lines):

diff --git a/libpurple/protocols/jabber/google/google_session.c b/libpurple/protocols/jabber/google/google_session.c
--- a/libpurple/protocols/jabber/google/google_session.c
+++ b/libpurple/protocols/jabber/google/google_session.c
@@ -60,6 +60,23 @@ typedef struct {
 	 							   to media (ie. after getting relay credentials */
 } GoogleAVSessionData;
 
+typedef struct {
+	NiceAgent *agent;
+	guint stream_id;
+	guint component_id;
+	gboolean agent_attached;
+	guint share_channel_id;
+	HttpStatus http_status;
+	gchar *status_line;
+	gboolean is_chunked;
+	guint64 content_length;
+	gchar *write_buffer;
+	guint write_len;
+	gchar *read_buffer;
+	guint read_len;
+} ShareChannel;
+
+
 /*TODO: When cleaning up typedef struct {
 
   } GoogleShareManifest;
@@ -1212,7 +1229,9 @@ gtalk_xfer_send_candidates(GoogleSession
 
 //		purple_debug_info("google_session", "Setting even more attributes now.. : \n");
 /*TODO: Fix preference*/
-		xmlnode_set_attrib(candidate, "preference", "0.9");
+		xmlnode_set_attrib(candidate, "preference", type == NICE_CANDIDATE_TYPE_HOST ? "0.000015":
+				   "0.000000");
+
 		xmlnode_set_attrib(candidate, "protocol", "udp");
 /*TODO: ADD RELAY SERVERS ASAP! Are they working now?*/
 		/*CHECK THIS : TODO Type*/
@@ -1268,11 +1287,13 @@ cb_candidate_gathering_done(NiceAgent *a
 
 		for(; iter; iter = iter->next) {
 			NiceCandidate *candid = (NiceCandidate *)iter->data;
-			candid->username = g_strdup(local_ufrag);
-			candid->password = g_strdup(local_password);
+			if(!candid->username)
+				candid->username = g_strdup(local_ufrag);
+			if(!candid->password)
+				candid->password = g_strdup(local_password);
 
                         /*Insert it into our GoogleXferSession's local_share_candidates*/
-			share_session->local_share_candidates = g_list_prepend(share_session->local_share_candidates, candid);
+			share_session->local_share_candidates = g_list_append(share_session->local_share_candidates, candid);
 			/*TODO: local_share_candidates are being added to the list here itself. What about the part that follows?
 			  Shouldn't relay candidates and these candidates be togeter?*/
 		}
@@ -1345,10 +1366,9 @@ This will most probably end in successfu
 	guint stream_id = share_session->stream_id;
 
 	if(!g_object_get_data(G_OBJECT (agent), "stun->server")) {
-		purple_debug_info("google_session", "Agent's STUN is NULL..");
+		purple_debug_info("google_session", "Setting Agent's STUN..");
 		g_object_set(G_OBJECT (agent), "stun-server", js->stun_ip, NULL);
 		g_object_set(G_OBJECT (agent), "stun-server-port", js->stun_port, NULL);
-		purple_debug_info("google_session", "Set Stun info");
 	}
 	else
 		purple_debug_info("google_session", "Agent's stun was not NULL.");
@@ -1383,7 +1403,7 @@ This will most probably end in successfu
 		purple_debug_info("google_session", "Gather Candidates returned TRUE\n");
 	g_main_loop_run (gloop);
 	g_main_loop_unref(gloop); /*TODO: Check if gloop is causing a CRASH when Destroying pidgin instance*/
-	g_object_unref(agent);
+	g_object_unref(agent); /*Something here is causing a CRASH on destroying pidgin..Find out what! TODO*/
 	return;
 }
 
@@ -1776,9 +1796,10 @@ google_session_parse_iq(JabberStream *js
 		purple_debug_info("google_session", "Inside transport-accept handle block..Calling it now..\n");
 		google_session_handle_transport_accept(js, session, sess, iq_id);
 	} else if (!strcmp(type, "transport-info")) {
-		gtalk_xfer_prepare_candidates(session);
+//		gtalk_xfer_prepare_candidates(session);
 		google_session_handle_transport_info(js, session, sess, iq_id);
 
+
 //		google_xfer_send(js,session); TODO: Clean up a bit.
 //		purple_debug_info("google_session", "Back in parse_iq\n");
 //		if(js->stun_ip)



More information about the Commits mailing list