Only in .: gaim-big-ft.patch
diff -ru ../../orig/gaim-1.0.3/src/connection.h ./src/connection.h
--- ../../orig/gaim-1.0.3/src/connection.h	2004-11-14 22:13:23.995469736 +0530
+++ ./src/connection.h	2004-11-14 22:25:21.831342096 +0530
@@ -105,6 +105,8 @@
 	                                  automatically reconnected
 	                                  (incorrect password, etc.)         */
 	guint disconnect_timeout;    /**< Timer used for nasty stack tricks  */
+	/* AJ */
+	GHashTable *xfers;
 };
 
 #ifdef __cplusplus
Only in ./src/protocols/yahoo: y
diff -ru ../../orig/gaim-1.0.3/src/protocols/yahoo/yahoo_filexfer.c ./src/protocols/yahoo/yahoo_filexfer.c
--- ../../orig/gaim-1.0.3/src/protocols/yahoo/yahoo_filexfer.c	2004-11-14 22:13:24.534387808 +0530
+++ ./src/protocols/yahoo/yahoo_filexfer.c	2004-11-14 22:26:44.956705120 +0530
@@ -152,12 +152,158 @@
 	g_free(filename);
 }
 
+/* Added by AJ (Ankit Jain radical@corewars.org) */
+static void yahoo_sendfile_p2p(gpointer data, gint source, GaimInputCondition condition)
+{
+	GaimXfer *xfer;
+	GaimConnection* gc;
+	gchar *buf, *resp;
+	char *ptr, *ptr2;
+
+	xfer=NULL;
+	gc = data;
+
+	buf = g_malloc(1024);
+	if(read(source, buf, 1024)>0){
+		/*printf("READ : %s\n", buf);*/
+
+		if(!(ptr = strchr(buf, '/')) ){
+			/* Indicate error.. */
+			gaim_debug(GAIM_DEBUG_ERROR, "yahoo", "Invalid URL : %s\n", buf);
+			/* Close this fd and remove its watcher */
+			gaim_input_remove(xfer->watcher);
+			xfer->watcher =0;		
+			close(source);
+
+			return;
+		}
+
+		if(strncmp(ptr, "/Messenger.", 11) == 0){
+			/* /Messenger found.. */
+			ptr += 11;		
+
+			/* Find the KEY */
+			ptr2 = strrchr(ptr, '&');	
+			if(strncmp(ptr2, "&K=", 3)==0){
+				ptr2 += 3;	
+				/* Find the end of the key.. which is a space! */	
+				ptr = strchr(ptr2, ' ');
+				*ptr =0;
+				
+				if( (xfer = (GaimXfer*) g_hash_table_lookup(gc->xfers, ptr2)) ){
+					/* Check for request type : HEAD or GET! */
+					if(strncmp(buf, "HEAD", 4)==0){
+						resp = g_strdup_printf("HTTP/1.0 200 OK\r\nMime-version: 1.0\r\nContent-length: %d\r\n\r\n", xfer->size);
+						write(source, resp, strlen(resp));	
+						gaim_debug(GAIM_DEBUG_INFO, "yahoo", "Got a HEAD request for content-length. Replying with %s\n", resp);
+						gaim_input_remove(xfer->watcher);
+						xfer->watcher =0;		
+						close(source);
+					
+						g_free(resp);
+
+					}else 
+					if(strncmp(buf, "GET", 3)==0){ 
+						GaimConnection *gc;
+						/* Send the file now!!!! */
+						xfer->fd = source;
+						gaim_input_remove(xfer->watcher);
+						xfer->watcher =0;		
+
+						gc = gaim_account_get_connection(xfer->account);
+						g_hash_table_remove(gc->xfers, ptr2);
+						gaim_xfer_start(xfer, source, NULL, 0);
+					}else{
+						gaim_debug(GAIM_DEBUG_ERROR, "yahoo", "Unrecognized HTTP request: %s\n", buf);
+					}
+				}
+				/* Put the space back now.. */
+				*ptr = ' ';
+			}
+
+		}
+	}else{
+		perror("yahoo_sendfile_p2p");
+		/* closing fd..hmm*/
+		close(source);
+		gaim_input_remove(xfer->watcher);
+		xfer->watcher =0;		
+	}
+
+	g_free(buf);
+
+}
+
+static void yahoo_sendfile_connected_p2p(gpointer data, gint source, GaimInputCondition condition)
+{
+	GaimXfer *xfer;
+	GaimConnection* gc;
+	struct sockaddr addr;
+	socklen_t addrlen= sizeof(addr);
+
+	xfer = data;	
+	gc = gaim_account_get_connection(xfer->account);
+
+	/*printf("Got an incoming connection!!!\n");*/
+	xfer->fd = accept(source, &addr, &addrlen);
+	/* install listener for actual data.. */
+	xfer->watcher = gaim_input_add(xfer->fd, GAIM_INPUT_READ, yahoo_sendfile_p2p, gc);
+
+	/* printf("Added watcher.. %d for %d\n", xfer->watcher, xfer->fd); */
+
+	/* Close the listening socket.. */
+	/* close(source); */
+}
+
+static gboolean my_timeout(gpointer data)
+{
+	struct yahoo_xfer_data *xfer_data;
+	GaimConnection *gc;
+	GaimAccount *account;
+	struct yahoo_data *yd;
+	GaimXfer *xfer;
+	
+	xfer = data;
+
+	gaim_debug(GAIM_DEBUG_INFO, "yahoo", "TIMEOUT!!!");
+
+	/* REMOVE the hash table entry inserted earlier.. */
+	
+	xfer_data = xfer->data;
+	gc = xfer_data->gc;
+	yd = gc->proto_data;
+	account = gaim_connection_get_account(gc);
+
+	if (yd->jp) {
+		if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host",  YAHOOJP_XFER_HOST),
+							   gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
+							   yahoo_sendfile_connected, xfer) == -1)
+		{
+			gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
+							_("Unable to establish file descriptor."));
+			gaim_xfer_cancel_remote(xfer);
+		}
+	} else {
+		if (gaim_proxy_connect(account, gaim_account_get_string(account, "xfer_host",  YAHOO_XFER_HOST),
+							   gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
+							   yahoo_sendfile_connected, xfer) == -1)
+		{
+			gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
+							_("Unable to establish file descriptor."));
+			gaim_xfer_cancel_remote(xfer);
+		}
+	}
+
+}
+
 static void yahoo_xfer_init(GaimXfer *xfer)
 {
 	struct yahoo_xfer_data *xfer_data;
 	GaimConnection *gc;
 	GaimAccount *account;
 	struct yahoo_data *yd;
+	static int watcher=0;
+	static int listenfd=0;
 
 	xfer_data = xfer->data;
 	gc = xfer_data->gc;
@@ -165,12 +311,85 @@
 	account = gaim_connection_get_account(gc);
 
 	if (gaim_xfer_get_type(xfer) == GAIM_XFER_SEND) {
-		if (gaim_xfer_get_size(xfer) >= 1048577) {
+		/*if (gaim_xfer_get_size(xfer) >= 1048577) {
 			gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
 			                  _("Gaim cannot send files over Yahoo! that are bigger than "
 			                    "One Megabyte (1,048,576 bytes)."));
 			gaim_xfer_cancel_local(xfer);
-		} else {
+		} else {*/
+			{
+			/* AJ */
+			/* Tell the other guy to connect to us.. on a designated port..   */
+			struct yahoo_packet* pack;
+			gchar *buf, *key ;
+			int tmpfd;
+
+			if(!gc->xfers){
+				if(!(gc->xfers = g_hash_table_new(g_str_hash, g_str_equal)) ){
+					gaim_debug(GAIM_DEBUG_ERROR, "yahoo", "Could not setup a hash table!\n");
+
+					gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
+			             _("Internal Error."));
+					gaim_xfer_cancel_local(xfer);
+					return;
+				}
+			}
+			
+			xfer->filename = strrchr(xfer->local_filename, '/')+1;
+
+			/* Time to start listenin.. Umm.. do this before sendin the above packet.. to adjust the port!*/
+			if(( tmpfd = gaim_network_listen_range(6081, 6090)) < 0 ){
+				/* Check ..so that if we are already listening on a port.. then dont try to listen again! */
+				gaim_debug(GAIM_DEBUG_INFO, "yahoo", "Could not setup a listening socket on ports 6080-6090!\n");
+				//gaim_input_remove(watcher);
+
+				gaim_notify_error(gc, NULL, _("File Transfer Aborted"),
+			             _("Unable to setup listening sockets."));
+				gaim_xfer_cancel_local(xfer);
+
+				return;
+			}else
+				listenfd = tmpfd;
+
+			watcher=gaim_input_add(listenfd, GAIM_INPUT_READ, yahoo_sendfile_connected_p2p, xfer);
+
+			key = g_strdup_printf("%u", g_random_int());
+
+			/* Insert xfer into the hash table. */
+			/* Key has to be free'd by whoever handles the sending of the file.. */
+			g_hash_table_insert(gc->xfers, key, xfer);
+
+			pack = yahoo_packet_new(YAHOO_SERVICE_P2PFILEXFER, YAHOO_STATUS_AVAILABLE, yd->session_id);
+			yahoo_packet_hash(pack, 5, xfer->who);
+			yahoo_packet_hash(pack, 49, "FILEXFER");
+			yahoo_packet_hash(pack, 1, gaim_connection_get_display_name(gc));
+			yahoo_packet_hash(pack, 13, "1");
+			yahoo_packet_hash(pack, 27, xfer->filename);
+			yahoo_packet_hash(pack, 28, g_strdup_printf("%d",xfer->size));
+
+			/* Build the URL */
+			buf = g_strdup_printf("http://%s:%d/Messenger.%s.123%s?AppID=Messenger&UserID=%s&K=%s", gaim_network_get_my_ip(-1), gaim_network_get_port_from_fd(listenfd), xfer->who, xfer->filename, xfer->who, key);
+			yahoo_packet_hash(pack, 20, buf);
+			yahoo_packet_hash(pack, 14, "");
+
+			//buf2 = g_strdup_printf("Messenger.%s.123%s", xfer->who, xfer->filename);
+			yahoo_packet_hash(pack, 53, g_strdup_printf("Messenger.%s.123%s", xfer->who, xfer->filename));
+
+			yahoo_packet_hash(pack, 54, "MSG1.0");
+
+			gaim_debug(GAIM_DEBUG_INFO, "yahoo",
+			   "[yahoo_xfer_init] Sending request for file transfer.. [FROM HOST: %s]\n", buf);
+			yahoo_send_packet(yd, pack);
+
+			g_free(buf);
+			//g_free(buf2);
+
+			/*	printf("Watcher : %d for fd : %d\n", watcher, listenfd);*/
+
+			//g_timeout_add(10000, my_timeout, xfer);
+		
+
+			/* AJ
 			if (yd->jp) {
 				if (gaim_proxy_connect(account, gaim_account_get_string(account, "xferjp_host",  YAHOOJP_XFER_HOST),
 				                       gaim_account_get_int(account, "xfer_port", YAHOO_XFER_PORT),
@@ -190,6 +409,7 @@
 					gaim_xfer_cancel_remote(xfer);
 				}
 			}
+		*/
 		}
 	} else {
 		xfer->fd = gaim_proxy_connect(account, xfer_data->host, xfer_data->port,
@@ -205,6 +425,12 @@
 static void yahoo_xfer_start(GaimXfer *xfer)
 {
 	/* We don't need to do anything here, do we? */
+	gchar *buf;
+
+	if(xfer->type == GAIM_XFER_SEND){
+		buf = g_strdup_printf("HTTP/1.0 200 OK\r\nMime-version: 1.0\r\nContent-type: image/bmp\r\nContent-length: %d\r\n\r\n", xfer->size);
+		write(xfer->fd, buf, strlen(buf));	
+	}
 }
 
 static void yahoo_xfer_end(GaimXfer *xfer)
@@ -219,7 +445,6 @@
 	if (xfer_data)
 		yahoo_xfer_data_free(xfer_data);
 	xfer->data = NULL;
-
 }
 
 guint calculate_length(const gchar *l, size_t len)
@@ -250,6 +475,7 @@
 	}
 
 	len = read(xfer->fd, buf, sizeof(buf));
+	printf("Read %d bytes of %d [ %d ]\n", len, gaim_xfer_get_size(xfer), gaim_xfer_get_bytes_sent(xfer));
 
 	if (len <= 0) {
 		if ((gaim_xfer_get_size(xfer) > 0) &&
