/soc/2013/ashmew2/filetransferX: 2c9c092ab790: Added cb_nice_com...

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


Changeset: 2c9c092ab790d5d96b37f696cf9c89775cf38a70
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2013-08-17 18:05 +0530
Branch:	 filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/2c9c092ab790

Description:

Added cb_nice_component_writable

diffstat:

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

diffs (62 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
@@ -1113,7 +1113,6 @@ gtalk_xfer_handle_candidates(JabberStrea
 
 	if(candidate_node) {
 		gchar *type = xmlnode_get_attrib(candidate_node, "type");
-		purple_debug_info("google_session", "Reached Here..0\n");
 		candid->type = (!strcmp(type, "local") ? NICE_CANDIDATE_TYPE_HOST : 
 				!strcmp(type, "stun") ? NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE :
 				!strcmp(type, "relay") ? NICE_CANDIDATE_TYPE_RELAYED :
@@ -1125,19 +1124,16 @@ gtalk_xfer_handle_candidates(JabberStrea
 			purple_debug_info("google_session", "Remote Candidate is not UDP...Returning..\n");
 			return;
 		}
-		purple_debug_info("google_session", "Reached Here..1\n");
 		nice_address_init(&candid->addr);
 		nice_address_set_from_string(&candid->addr, xmlnode_get_attrib(candidate_node, "address"));
 		nice_address_set_port(&candid->addr, atoi(xmlnode_get_attrib(candidate_node, "port")));
 		candid->stream_id = share_session->stream_id;
-		purple_debug_info("google_session", "Reached Here..2\n");
 		candid->username = g_strdup(xmlnode_get_attrib(candidate_node, "username"));
 		if(!candid->username)
 			candid->username = g_strdup("");
 		candid->password = g_strdup(xmlnode_get_attrib(candidate_node, "password"));
 		if(!candid->password)
 			candid->password = g_strdup("");
-		purple_debug_info("google_session", "Reached Here..3\n");
 		candidate_list = g_slist_append(candidate_list, candid);
 		nice_agent_set_remote_candidates(share_session->share_agent, 
 						 share_session->stream_id, share_session->share_channel->component_id, 
@@ -1454,10 +1450,16 @@ char *nice_component_state_to_str(guint 
 void cb_nice_component_state_changed(NiceAgent *agent,guint stream_id, guint component_id,
 				      guint state, gpointer user_data)
 {
-	purple_debug_info("google_session", "State of NiceAgent Changed...Current State : %s\n", nice_component_state_to_str(state));
+	purple_debug_info("google_session", "State of NiceAgent Changed...Current State : [%d]%s\n", state, nice_component_state_to_str(state));
 	/*TODO: Add more stuff related to state changes here*/
 }
 
+void cb_nice_component_writable(NiceAgent *agent, guint stream_id, guint component_id,
+				gpointer user_data)  
+{
+	purple_debug_info("google_session", "WRITABLE NOW ! (Inside cb_nice_component_writable\n");
+}
+
 void
 gtalk_xfer_prepare_candidates(GoogleSession *session)
 {	
@@ -1550,10 +1552,9 @@ This will most probably end in successfu
 	g_signal_connect  (G_OBJECT (agent), "component-state-changed",
 				    G_CALLBACK (cb_nice_component_state_changed), NULL);
 	
-/*TODO: Uncomment and use me.
 	g_signal_connect (G_OBJECT (agent), "reliable-transport-writable",
-				    G_CALLBACK (nice_component_writable), G_OBJECT (self));
-*/
+				    G_CALLBACK (cb_nice_component_writable), G_OBJECT (self));
+
 	if(!nice_agent_gather_candidates (agent, stream_id))
 		purple_debug_info("google_session", "Gather candidates returned FALSE\n");
 	else



More information about the Commits mailing list