Re: [Evolution-hackers] Backport of fix to "Too Many Open Files" problem

2007-01-10 Thread Matthew Barnes
On Wed, 2007-01-10 at 23:26 +0100, Øystein Gisnås wrote:
> I see users on 2.6.3 struggle with the problem described at
> http://mail.gnome.org/archives/evolution-list/2006-October/msg00130.html
> http://bugzilla.gnome.org/show_bug.cgi?id=34 and
> http://bugzilla.gnome.org/show_bug.cgi?id=356913
> 
> I've looked at the patch (it's said to be fixed in 2.9.1). Looks like
> someone attempted a fix and it's been reverted and rewritten again.
> What's the correct patch for the problem. Does anyone have a gut
> feeling if it's good to backport that to 2.6.3?

I wrote the patch.

You have good timing because we discovered a critical flaw in the patch
for bug #34 just today.  I recommend applying the patch in bug
#34, followed by the patch for bug #384183.  I think it should be
safe to backport to 2.6.3; it's a rewrite of some very old code.

Note that it does break the ABI of libedataserver.

Matthew Barnes
Red Hat Evolution Maintainer

___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] Backport of fix to "Too Many Open Files" problem

2007-01-10 Thread Øystein Gisnås
I see users on 2.6.3 struggle with the problem described at
http://mail.gnome.org/archives/evolution-list/2006-October/msg00130.html
http://bugzilla.gnome.org/show_bug.cgi?id=34 and
http://bugzilla.gnome.org/show_bug.cgi?id=356913

I've looked at the patch (it's said to be fixed in 2.9.1). Looks like
someone attempted a fix and it's been reverted and rewritten again.
What's the correct patch for the problem. Does anyone have a gut
feeling if it's good to backport that to 2.6.3?

Cheers,
Øystein Gisnås
Debian Evolution Maintainer Team
___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers


Re: [Evolution-hackers] Quick 'n dirty POP summary support

2007-01-10 Thread Philip Van Hoof

About this one and FYI:

On Wed, 2007-01-10 at 20:46 +0100, Philip Van Hoof wrote:
> @@ -386,6 +433,11 @@
> if (pop3_store->cache && fi->uid)
> camel_data_cache_remove(pop3_store->cache, "cache", 
> fi->uid, NULL);
> }
> +
> +
> +   /* TNY TODO Shouldn't this remove message from memory? Oh 
> well, adding it */
> +   camel_object_unref (CAMEL_OBJECT (message)); 


I think this is a memory leak in the existing implementation of
camel_pop3_delete_old ("message" is never unreferenced, yet created).

If it is a memory leak, and it looks like it is, then this is actually a
huge one. No? (entire messages are leaked, or at least streams to files
being cached, keeping files open and stuff like that).




-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog




___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers


[Evolution-hackers] Quick 'n dirty POP summary support

2007-01-10 Thread Philip Van Hoof
Hi there,

This is a quick 'n dirty summary support for the Camel POP provider.

I'm not sure how this could be useful for Evolution, as Evolution
doesn't use support for summaries with POP accounts (it filters the
messages from the cache to a local folder of which its Camel provider
has summary support).

After this patch, you can use the POP Cache as only copy where the final
message is stored (if cached). It will create a summary file and
use/load that one for displaying the summary.

This has only been tested with tinymail, as I don't really feel like
adjusting Evolution not to do filtering but rather displaying POP
accounts like any other account (which is what would test this).

Note that this code is going to be slower than not supporting summaries
because I need the "TOP %s 1" of each message when refreshing the folder
info, whereas Evolution (if it uses the current filter technique) only
needs the list of UIDs (the LIST POP command).

This quick 'n dirty implementation is not tested very well. I still need
to check for silly memory leaks and stuff like that too.


As usual I send this stuff early so that the Evolution hackers have a
idea of what I'm cooking early on (I'm pro REAL development, rather than
pro bureaucratic development by only sending uber-cool finished patches:
that is not how software development works the best -- but anyway --).

Feel free to take a look at this, and let me know what you think of it.
I'm for example thinking about making it possible to disabling the
summary support (for example because Evolution, for example, doesn't
need it). It's going in tinymail's camel-lite anyhow .. but I would of
course prefer to have the delta of changes small.



-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog



Index: camel-pop3-folder.c
===
--- camel-pop3-folder.c	(revision 1300)
+++ camel-pop3-folder.c	(working copy)
@@ -54,8 +54,9 @@
 static void pop3_sync (CamelFolder *folder, gboolean expunge, CamelException *ex);
 static gint pop3_get_message_count (CamelFolder *folder);
 static GPtrArray *pop3_get_uids (CamelFolder *folder);
 static gboolean pop3_set_message_flags (CamelFolder *folder, const char *uid, guint32 flags, guint32 set);
+static CamelMimeMessage *pop3_get_top (CamelFolder *folder, const char *uid, gboolean full, CamelException *ex);
 
 static void
 camel_pop3_folder_class_init (CamelPOP3FolderClass *camel_pop3_folder_class)
@@ -123,19 +124,44 @@
 camel_pop3_folder_new (CamelStore *parent, CamelException *ex)
 {
 	CamelFolder *folder;
+	CamelPOP3Store *p3store = (CamelPOP3Store*) parent;
+	gchar *summary_file;
 
 	d(printf("opening pop3 INBOX folder\n"));
 	
 	folder = CAMEL_FOLDER (camel_object_new (CAMEL_POP3_FOLDER_TYPE));
 	camel_folder_construct (folder, parent, "inbox", "inbox");
 	
+	summary_file = g_strdup_printf ("%s/summary.mmap", p3store->root);
+	folder->summary = camel_folder_summary_new (folder);
+	camel_folder_summary_set_build_content (folder->summary, TRUE);
+	camel_folder_summary_set_filename (folder->summary, summary_file);
+
+	if (camel_folder_summary_load (folder->summary) == -1) {
+		camel_folder_summary_clear (folder->summary);
+		camel_folder_summary_touch (folder->summary);
+		camel_folder_summary_save (folder->summary);
+		camel_folder_summary_load (folder->summary);
+	}
+	g_free (summary_file);
+
+
 	/* mt-ok, since we dont have the folder-lock for new() */
 	camel_folder_refresh_info (folder, ex);/* mt-ok */
 	if (camel_exception_is_set (ex)) {
 		camel_object_unref (CAMEL_OBJECT (folder));
 		folder = NULL;
 	}
+
+	if (!folder->summary) {
+		camel_object_unref (CAMEL_OBJECT (folder));
+		camel_exception_setv (ex, CAMEL_EXCEPTION_SYSTEM,
+  _("Could not load summary for INBOX"));
+		return NULL;
+	}
 	
+	folder->folder_flags |= CAMEL_FOLDER_HAS_SUMMARY_CAPABILITY;
+
 	return folder;
 }
 
@@ -271,11 +297,31 @@
 	
 	camel_pop3_engine_command_free(pop3_store->engine, pcl);
 	
+	for (i=0;iuids->len;i++) 
+	{
+		CamelPOP3FolderInfo *fi = pop3_folder->uids->pdata[i];
+		CamelMessageInfoBase *mi;
+
+		mi = (CamelMessageInfoBase*) camel_folder_summary_uid (folder->summary, fi->uid);
+		if (!mi)
+		{
+			if (pop3_store->engine->capa & CAMEL_POP3_CAP_TOP) {
+			CamelMimeMessage *msg = pop3_get_top (folder, fi->uid, FALSE, NULL);
+			if (msg) camel_object_unref (CAMEL_OBJECT (msg));
+			} else {
+			CamelMimeMessage *msg = pop3_get_message (folder, fi->uid, NULL);
+			if (msg) camel_object_unref (CAMEL_OBJECT (msg));
+			}
+		} else
+			camel_message_info_free (mi);
+	}
+
 	if (pop3_store->engine->capa & CAMEL_POP3_CAP_UIDL) {
 		camel_pop3_engine_command_free(pop3_store->engine, pcu);
 	} else {
 		for (i=0;iuids->len;i++) {
 			CamelPOP3FolderInfo *fi = pop3_folder->uids->pdata[i];
+
 			if (fi->cmd) {
 camel_pop3_engine_command_free(pop3_store->engine, fi->cmd);
 fi->cmd = NU

Re: [Evolution-hackers] your Software Evolution 2.6.2 for Win32 on ComputerBILD covermount CD

2007-01-10 Thread Tor Lillqvist
Konstantin Breyer writes:
 > Join in. For the sake of good order, please fax the signed license
 > agreement (please delete inapplicable terms) back to us (+49/40/34
 > 72 93 77) and e-mail me the system requirement sheet.

You don't need any permission to redistribute Evolution. That's one
point of Open Source software. Read the license. (And anyway, even if
you would need permission, it isn't I who who would be the right
person to sign any agreements. Novell owns the copyright to Evolution,
and the copyright to the large number of Open Source libraries it uses
each have differing copyright owners.)

The only thing you *might* need permission for is to use the
"Evolution" trademark (which is owned by Novell). But I don't know how
strict this is? I am certainly no lawyer. Do all the Linux distros
that distribute Evolution have explicit permission to use the
"Evolution" name? At least, what you definitely should not do is to
claim that Novell would in any way support Evolution on Windows or
endorse your redistribution of it.

I don't have any "system requirement sheet" except that I know for
sure it won't work on Win9x or NT4.

Anyway, the 2.6.2 version is a bit old. Unfortunately there isn't any
all-inclusive end-user-friendly installer for the latest version,
2.8.2, like there is for 2.6.2. There is only .zip files with binaries
for the individual software packages at ftp.gnome.org.

--tml
___
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers