[evolution-patches] #41748, mails get stuck in outbox



The patch makes sure we always add a sending task no matter what url is
used for the (default) transport.

I think it will fix the problem.

 Z

Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.2711
diff -u -3 -r1.2711 ChangeLog
--- ChangeLog	30 Apr 2003 03:08:46 -0000	1.2711
+++ ChangeLog	30 Apr 2003 04:09:48 -0000
@@ -1,3 +1,16 @@
+2003-04-30  Not Zed  <NotZed Ximian com>
+
+	** See bug #41748
+	
+	* mail-send-recv.c (build_dialogue): make sure we dont add any
+	SEND_SEND types to the receive table.  When we add the SEND_SEND
+	type, key it on a fixed string SEND_URI_KEY.
+	(receive_done): if it is a SEND_SEND type, use SEND_URI_KEY to
+	remove it from the active list.
+	(mail_receive_uri): make sure we never add a SEND_SEND type to the
+	receive list.
+	(mail_send): key the send info on SEND_URI_KEY not transport url.
+
 2003-04-29  Jeremy Katz  <katzj redhat com>
 
 	* folder-browser-ui.c (fbui_sensitise_item): Don't just blindly
Index: mail-send-recv.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/mail-send-recv.c,v
retrieving revision 1.71
diff -u -3 -r1.71 mail-send-recv.c
--- mail-send-recv.c	24 Apr 2003 01:55:10 -0000	1.71
+++ mail-send-recv.c	30 Apr 2003 04:09:49 -0000
@@ -57,6 +57,9 @@
 /* ms between status updates to the gui */
 #define STATUS_TIMEOUT (250)
 
+/* pseudo-uri to key the send task on */
+#define SEND_URI_KEY "send-task:"
+
 /* send/receive email */
 
 /* ********************************************************************** */
@@ -347,7 +350,7 @@
 			send_info_t type;
 			
 			type = get_receive_type (source->url);
-			if (type == SEND_INVALID) {
+			if (type == SEND_INVALID || type == SEND_SEND) {
 				e_iterator_next (iter);
 				continue;
 			}
@@ -413,7 +416,7 @@
 	gtk_widget_show_all (GTK_WIDGET (table));
 	
 	if (outbox && destination) {
-		info = g_hash_table_lookup (data->active, destination);
+		info = g_hash_table_lookup (data->active, SEND_URI_KEY);
 		if (info == NULL) {
 			info = g_malloc0 (sizeof (*info));
 			info->type = SEND_SEND;
@@ -425,7 +428,7 @@
 			info->state = SEND_ACTIVE;
 			info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
 			
-			g_hash_table_insert (data->active, info->uri, info);
+			g_hash_table_insert (data->active, SEND_URI_KEY, info);
 			list = g_list_prepend (list, info);
 		} else if (info->timeout_id == 0)
 			info->timeout_id = gtk_timeout_add (STATUS_TIMEOUT, operation_status_timeout, info);
@@ -583,7 +586,10 @@
 
 	/* remove/free this active download */
 	d(printf("%s: freeing info %p\n", G_GNUC_FUNCTION, info));
-	g_hash_table_remove(info->data->active, info->uri);
+	if (info->type == SEND_SEND)
+		g_hash_table_remove(info->data->active, SEND_URI_KEY);
+	else
+		g_hash_table_remove(info->data->active, info->uri);
 	info->data->infos = g_list_remove(info->data->infos, info);
 
 	if (g_hash_table_size(info->data->active) == 0) {
@@ -853,7 +859,7 @@
 	d(printf("starting non-interactive download of '%s'\n", uri));
 	
 	type = get_receive_type (uri);
-	if (type == SEND_INVALID) {
+	if (type == SEND_INVALID || type == SEND_SEND) {
 		d(printf ("unsupported provider: '%s'\n", uri));
 		return;
 	}
@@ -915,7 +921,7 @@
 		return;
 	
 	data = setup_send_data ();
-	info = g_hash_table_lookup (data->active, transport->url);
+	info = g_hash_table_lookup (data->active, SEND_URI_KEY);
 	if (info != NULL) {
 		d(printf("send of %s still in progress\n", transport->url));
 		return;
@@ -943,7 +949,7 @@
 	
 	d(printf("Adding new info %p\n", info));
 	
-	g_hash_table_insert (data->active, info->uri, info);
+	g_hash_table_insert (data->active, SEND_URI_KEY, info);
 	
 	/* todo, store the folder in info? */
 	mail_send_queue (outbox_folder, info->uri,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]