diff src/protocols/yahoo/yahoo_filexfer.c @ 11644:f4e58e94ced3

[gaim-migrate @ 13922] Yahoo! whitespace cleanup from Peter Lawler Gracias! committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Wed, 12 Oct 2005 04:02:46 +0000
parents 7fab28c991f3
children 81806e9241be
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo_filexfer.c	Wed Oct 12 02:47:31 2005 +0000
+++ b/src/protocols/yahoo/yahoo_filexfer.c	Wed Oct 12 04:02:46 2005 +0000
@@ -32,8 +32,6 @@
 #include "yahoo_filexfer.h"
 #include "yahoo_doodle.h"
 
-
-
 struct yahoo_xfer_data {
 	gchar *host;
 	gchar *path;
@@ -108,8 +106,6 @@
 	account = gaim_connection_get_account(gc);
 	yd = gc->proto_data;
 
-
-
 	if (source < 0) {
 		gaim_xfer_error(GAIM_XFER_RECEIVE, gaim_xfer_get_account(xfer),
 				xfer->who, _("Unable to connect."));
@@ -120,13 +116,12 @@
 	xfer->fd = source;
 	gaim_xfer_start(xfer, source, NULL, 0);
 
-
 	pkt = yahoo_packet_new(YAHOO_SERVICE_FILETRANSFER, YAHOO_STATUS_AVAILABLE, yd->session_id);
 
 	size = g_strdup_printf("%" G_GSIZE_FORMAT, gaim_xfer_get_size(xfer));
 	filename = g_path_get_basename(gaim_xfer_get_local_filename(xfer));
 	encoded_filename = yahoo_string_encode(gc, filename, NULL);
-	
+
 	yahoo_packet_hash(pkt, "sssss", 0, gaim_connection_get_display_name(gc),
 	                  5, xfer->who, 14, "", 27, encoded_filename, 28, size);
 
@@ -141,7 +136,8 @@
 	                       "Host: %s:%d\r\n"
 	                       "Cookie: %s\r\n"
 	                       "\r\n",
-			       host, port, content_length + 4 + gaim_xfer_get_size(xfer), host, port, buf);
+			       host, port, content_length + 4 + gaim_xfer_get_size(xfer),
+			       host, port, buf);
 	write(xfer->fd, post, strlen(post));
 
 	yahoo_packet_send_special(pkt, xfer->fd, 8);
@@ -212,7 +208,6 @@
 	account   = gaim_xfer_get_account(xfer);
 	xfer_data = xfer->data;
 
-
 	if (xfer_data)
 		yahoo_xfer_data_free(xfer_data);
 	xfer->data = NULL;
@@ -231,7 +226,6 @@
 	return 0;
 }
 
-
 ssize_t yahoo_xfer_read(guchar **buffer, GaimXfer *xfer)
 {
 	gchar buf[4096];
@@ -257,7 +251,6 @@
 			return -1;
 	}
 
-
 	if (!xd->started) {
 		xd->rxqueue = g_realloc(xd->rxqueue, len + xd->rxlen);
 		memcpy(xd->rxqueue + xd->rxlen, buf, len);
@@ -355,7 +348,7 @@
 void yahoo_process_p2pfilexfer( GaimConnection *gc, struct yahoo_packet *pkt )
 {
 	GSList	*l		= pkt->hash;
-	
+
 	char	*me 		= NULL;
 	char	*from		= NULL;
 	char	*service	= NULL;
@@ -363,50 +356,49 @@
 	char	*command	= NULL;
 	char	*imv		= NULL;
 	char	*unknown	= NULL;
-	
+
 	// Get all the necessary values from this new packet
 	while( l )
 	{
 		struct yahoo_pair *pair = l->data;
-		
+
 		if( pair->key == 5 )		// Get who the packet is for
 			me = pair->value;
-		
+
 		if( pair->key == 4 )		// Get who the packet is from
 			from = pair->value;
-		
+
 		if( pair->key == 49 )		// Get the type of service
 			service = pair->value;
-		
+
 		if( pair->key == 14 )		// Get the 'message' of the packet
 			message = pair->value;
-		
+
 		if( pair->key == 13 )		// Get the command associated with this packet
 			command = pair->value;
-		
+
 		if( pair->key == 63 )		// IMVironment name and version
 			imv = pair->value;
 
 		if( pair->key == 64 )		// Not sure, but it does vary with initialization of Doodle
 			unknown = pair->value;	// So, I'll keep it (for a little while atleast)
-		
+
 		l = l->next;
 	}
-	
+
 	// If this packet is an IMVIRONMENT, handle it accordingly
 	if( !strcmp( service, "IMVIRONMENT" ) )
 	{
 		// Check for a Doodle packet and handle it accordingly
 		if( !strcmp( imv, "doodle;11" ) )
 			yahoo_doodle_process( gc, me, from, command, message );
-		
+
 		// If an IMVIRONMENT packet comes without a specific imviroment name
 		if( !strcmp( imv, ";0" ) )
 		{
 			// It is unfortunately time to close all IMVironments with remote client
 			yahoo_doodle_command_got_shutdown( gc, from );
 		}
-			
 	}
 }
 
@@ -419,12 +411,9 @@
 	long expires = 0;
 	GaimXfer *xfer;
 	struct yahoo_xfer_data *xfer_data;
-
 	char *service = NULL;
-
 	char *filename = NULL;
 	unsigned long filesize = 0L;
-
 	GSList *l;
 
 	for (l = pkt->hash; l; l = l->next) {
@@ -440,12 +429,10 @@
 			url = pair->value;
 		if (pair->key == 38)
 			expires = strtol(pair->value, NULL, 10);
-
 		if (pair->key == 27)
 			filename = pair->value;
 		if (pair->key == 28)
 			filesize = atol(pair->value);
-
 		if (pair->key == 49)
 			service = pair->value;
 	}
@@ -467,7 +454,6 @@
 	if (!url || !from)
 		return;
 
-
 	/* Setup the Yahoo-specific file transfer data */
 	xfer_data = g_new0(struct yahoo_xfer_data, 1);
 	xfer_data->gc = gc;
@@ -531,7 +517,6 @@
 	xfer_data = g_new0(struct yahoo_xfer_data, 1);
 	xfer_data->gc = gc;
 
-
 	/* Build the file transfer handle. */
 	xfer = gaim_xfer_new(gc->account, GAIM_XFER_SEND, who);
 	xfer->data = xfer_data;