/soc/2013/ashmew2/filetransferX: 28622c22b606: Broken Gtalk FT

Ashish Gupta ashmew2 at gmail.com
Mon Aug 5 16:01:23 EDT 2013


Changeset: 28622c22b60625a07b77f8cea3780eeaa88d2e9b
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2013-08-06 01:31 +0530
Branch:	 filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/28622c22b606

Description:

Broken Gtalk FT

diffstat:

 libpurple/protocols/jabber/google/google_session.c |  48 +++++++++++-----------
 1 files changed, 24 insertions(+), 24 deletions(-)

diffs (77 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
@@ -1001,6 +1001,27 @@ gtalk_port_cb(int listenfd, gpointer dat
 }
 
 static void
+gtalk_xfer_start(PurpleXfer *xfer)
+{
+	purple_debug_info("google_session", "Inside gtalk_xfer_start()\n");
+
+/*Reading the whole file into memory as it's very experimental right now, Need to fix it for Bigger Files*/
+
+	if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {
+		guchar *buffer = g_malloc( xfer->bytes_remaining );
+		int size = fread( buffer, xfer->bytes_remaining, 1, xfer->dest_fp );
+		int wrote = purple_xfer_write( xfer, buffer, xfer->bytes_remaining );
+
+		if ( wrote > 0 )
+			purple_xfer_set_bytes_sent( xfer, wrote );
+
+		/* free the buffer */
+		g_free( buffer );
+		buffer = NULL;
+	}
+}
+
+static void
 gtalk_xfer_init(PurpleXfer *xfer)
 {
 	GoogleSession *session = (GoogleSession *)(xfer->data);
@@ -1027,42 +1048,21 @@ gtalk_xfer_init(PurpleXfer *xfer)
 			break;
 		}
 	}
-	purple_xfer_start( xfer, -1, xfer->remote_ip, xfer->remote_port );
+	gtalk_xfer_start(xfer);
+	//	purple_xfer_start( xfer, -1, xfer->remote_ip, xfer->remote_port );
 	
 }
 
-static void
-gtalk_xfer_start(PurpleXfer *xfer)
-{
-	purple_debug_info("google_session", "Inside gtalk_xfer_start()\n");
-
-/*TODO: Reading the whole file into memory as it's very experimental right now, Need to fix it for Bigger Files*/
-
-	if(purple_xfer_get_type(xfer) == PURPLE_XFER_SEND) {
-		guchar *buffer = g_malloc( xfer->bytes_remaining );
-		int size = fread( buffer, xfer->bytes_remaining, 1, xfer->dest_fp );
-		int wrote = purple_xfer_write( xfer, buffer, xfer->bytes_remaining );
-
-		if ( wrote > 0 )
-			purple_xfer_set_bytes_sent( xfer, wrote );
-
-		/* free the buffer */
-		g_free( buffer );
-		buffer = NULL;
-	}
-}
 
 static void 
 google_session_initiate_file_transfer(JabberStream *js, GoogleSession *session)
 {
 	PurpleXfer *xfer = purple_xfer_new(purple_connection_get_account(js->gc), PURPLE_XFER_SEND, session->remote_jid);
 	xfer->data = session;
+	purple_debug_info("google_session", "inside google_session_initiate_file_transfer\n");
 
 	purple_xfer_set_init_fnc( xfer, gtalk_xfer_init );
 	purple_xfer_set_start_fnc(xfer, gtalk_xfer_start);
-	purple_debug_info("google_session", "inside google_session_initiate_file_transfer.Requesting Xfer..\n");	
-	purple_xfer_request(xfer);
-	
 }
 
 static void



More information about the Commits mailing list