/soc/2013/ashmew2/filetransferY: 1d0103b4ebc3: Added google_shar...

Ashish Gupta ashmew2 at gmail.com
Sat Feb 1 07:55:20 EST 2014


Changeset: 1d0103b4ebc3fe39a78ce93781cf5749ea110132
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2014-02-01 14:09 +0530
Branch:	 filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferY/rev/1d0103b4ebc3

Description:

Added google_share.c and google_share.h

diffstat:

 libpurple/protocols/jabber/Makefile.am             |   2 +
 libpurple/protocols/jabber/google/google_session.c |  15 +++-
 libpurple/protocols/jabber/google/google_session.h |   5 +-
 libpurple/protocols/jabber/google/google_share.c   |  68 ++++++++++++++++++++++
 libpurple/protocols/jabber/google/google_share.h   |  24 +++++++
 5 files changed, 107 insertions(+), 7 deletions(-)

diffs (183 lines):

diff --git a/libpurple/protocols/jabber/Makefile.am b/libpurple/protocols/jabber/Makefile.am
--- a/libpurple/protocols/jabber/Makefile.am
+++ b/libpurple/protocols/jabber/Makefile.am
@@ -37,6 +37,8 @@ JABBERSOURCES = \
 			  google/google_roster.h \
 			  google/google_session.c \
 			  google/google_session.h \
+			  google/google_share.c \
+			  google/google_share.h \
 			  google/jingleinfo.c \
 			  google/jingleinfo.h \
 			  google/relay.c \
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
@@ -48,25 +48,30 @@ typedef enum {
 } GoogleXferChannelState;
 
 typedef struct {
-	gchar *filename;                            /*File Details*/
+	gchar *filename;        /*File Details*/
 	guint64 filesize;
 	gchar *preview_url;
 	gchar *source_url;
 	PurpleXfer *xfer;
-	NiceAgent *share_agent; /*Needs to have a manifest Entry for Folder Sharing: TODO*/
+	NiceAgent *share_agent; /*Needs to have a manifest
+				  Entry for Folder Sharing: TODO*/
 	gchar *channel_name;
 	NiceComponentState agent_state;
 	PurpleCircBuffer *buffer; 
 	GoogleXferChannelState channel_state;
 	gint stream_id;
 	gboolean candidates_gathered;	
-	gboolean file_opened;               /* Stuff for using file buffer for sending Gtalk Files.. */ 
+	gboolean file_opened;   /* Stuff for using file buffer 
+				   for sending Gtalk Files.. */ 
 	FILE *file_to_send;
 	char *file_buf;
 	int file_buf_current_size;
 	int file_buf_sent;
-	GSList *remote_share_candidates; /* lists of NiceCandidates */
+
+	GSList *remote_share_candidates; /* lists of 
+					    NiceCandidates */	
 	GSList *local_share_candidates;	
+
 } GoogleXferSessionData; 
 
 typedef struct {
@@ -113,7 +118,7 @@ google_session_id_equal(gconstpointer a,
 	return !strcmp(c->id, d->id) && !strcmp(c->initiator, d->initiator);
 }
 
- void
+void
 google_session_destroy(GoogleSession *session)
 {
 	JabberStream *js = session->js;	
diff --git a/libpurple/protocols/jabber/google/google_session.h b/libpurple/protocols/jabber/google/google_session.h
--- a/libpurple/protocols/jabber/google/google_session.h
+++ b/libpurple/protocols/jabber/google/google_session.h
@@ -37,7 +37,7 @@ typedef enum {
 } GoogleSessionState;
 
 typedef struct {
-	GoogleSessionId id;
+  	GoogleSessionId id;
 	GoogleSessionState state;
 	JabberStream *js;
 	char *remote_jid;
@@ -45,7 +45,8 @@ typedef struct {
 	xmlnode *description;		/* store incoming description through
 					   relay credential fetching */
 	gboolean relay_processing;
-	gboolean share;                 /*for indicating whether it's a fileXfer session*/
+	gboolean share;                 /*for indicating whether it's a 
+					  fileXfer session*/
 	gboolean session_should_die;
 	gpointer session_data;
 } GoogleSession;
diff --git a/libpurple/protocols/jabber/google/google_share.c b/libpurple/protocols/jabber/google/google_share.c
new file mode 100644
--- /dev/null
+++ b/libpurple/protocols/jabber/google/google_share.c
@@ -0,0 +1,68 @@
+/**
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+#include <stdlib.h>
+#include "internal.h"
+#include "debug.h"
+#include "google_session.h"
+#include "relay.h"
+#include "jingle/jingle.h"
+#include "jingle/transport.h"
+#include "network.h"
+#include "stun.h"
+#include "media.h"
+#include "relay.h"
+#include <nice/agent.h>
+
+typedef enum {
+	GTALK_XFER_CHANNEL_INITIALIZED = 0,
+	GTALK_XFER_CHANNEL_HTTP_GET_NOT_SENT,
+	GTALK_XFER_CHANNEL_SENT_HTTP_GET,
+	GTALK_XFER_CHANNEL_HTTP_GET_RECEIVED,
+	GTALK_XFER_CHANNEL_HTTP_OK_SENT,
+	GTALK_XFER_CHANNEL_HTTP_SENDING,
+	GTALK_XFER_CHANNEL_HTTP_RECEIVING,
+	GTALK_XFER_CHANNEL_HTTP_TRANSFERRING,
+	GTALK_XFER_CHANNEL_HTTP_SENDING_COMPLETE,
+	GTALK_XFER_CHANNEL_HTTP_RECEIVING_COMPLETE,
+	GTALK_XFER_CHANNEL_PARSED_HTTP_RESPONSE_HEADER
+} GoogleXferChannelState;
+
+typedef struct {
+	gchar *filename;                            /*File Details*/
+	guint64 filesize;
+	gchar *preview_url;
+	gchar *source_url;
+	PurpleXfer *xfer;
+	NiceAgent *share_agent; /*Needs to have a manifest Entry for Folder Sharing: TODO*/
+	gchar *channel_name;
+	NiceComponentState agent_state;
+	PurpleCircBuffer *buffer; 
+	GoogleXferChannelState channel_state;
+	gint stream_id;
+	gboolean candidates_gathered;	
+	gboolean file_opened;               /* Stuff for using file buffer for sending Gtalk Files.. */ 
+	FILE *file_to_send;
+	char *file_buf;
+	int file_buf_current_size;
+	int file_buf_sent;
+	GSList *remote_share_candidates; /* lists of NiceCandidates */
+	GSList *local_share_candidates;	
+} GoogleXferSessionData; 
diff --git a/libpurple/protocols/jabber/google/google_share.h b/libpurple/protocols/jabber/google/google_share.h
new file mode 100644
--- /dev/null
+++ b/libpurple/protocols/jabber/google/google_share.h
@@ -0,0 +1,24 @@
+/**
+ * Purple is the legal property of its developers, whose names are too numerous
+ * to list here.  Please refer to the COPYRIGHT file distributed with this
+ * source distribution.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ */
+
+#ifndef PURPLE_JABBER_GOOGLE_SHARE_H_
+#define PURPLE_JABBER_GOOGLE_SHARE_H_
+
+#endif /* PURPLE_JABBER_GOOGLE_SHARE_H_ */



More information about the Commits mailing list