[Commits] [SCM] claws branch, master, updated. 3.10.1-135-gee35990

claws at claws-mail.org claws at claws-mail.org
Fri Aug 1 07:51:04 CEST 2014


The branch, master has been updated
       via  ee35990fd9dac7032e86a107ae84c4ef22f0a444 (commit)
      from  6e2217d5bb5722a5426158f49bcaed95005a28f6 (commit)

Summary of changes:
 AUTHORS                      |    1 +
 src/gtk/authors.h            |    1 +
 src/plugins/pgpcore/sgpgme.c |   10 +---------
 3 files changed, 3 insertions(+), 9 deletions(-)


- Log -----------------------------------------------------------------
commit ee35990fd9dac7032e86a107ae84c4ef22f0a444
Author: Paul <paul at claws-mail.org>
Date:   Fri Aug 1 06:50:50 2014 +0100

    implement RFE 3238, 'GPG Mime Plugin exports contents to a tmpfile unnecessarily'
    
    The function gpgme_data_new_from_filepart() accepts a file stream with an offset.
    This information is already available via the mimeinfo variable.
    Instead of creating a new, temporary, file that contains some of the gpgme data, just use the original file as is.
    This saves resources especially on flash disks that have a limited number of writes.
    
    Patch by Kevin Day <thekevinday at gmail.com>

diff --git a/AUTHORS b/AUTHORS
index 3afe31e..04b8f75 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -306,3 +306,4 @@ contributors (in addition to the above; based on Changelog)
 	Peter Sarvas
 	Christoph Ruegge
 	Igor Gnatenko
+	Kevin Day
diff --git a/src/gtk/authors.h b/src/gtk/authors.h
index a1d6e13..cbfc14d 100644
--- a/src/gtk/authors.h
+++ b/src/gtk/authors.h
@@ -108,6 +108,7 @@ static char *CONTRIBS_LIST[] = {
 "Christian Cornelssen",
 "Palmer Dabbelt",
 "George Danchev",
+"Kevin Day",
 "Matthieu Dazy",
 "Ben Deering",
 "Pierric Descamps",
diff --git a/src/plugins/pgpcore/sgpgme.c b/src/plugins/pgpcore/sgpgme.c
index ede5f83..b247eb7 100644
--- a/src/plugins/pgpcore/sgpgme.c
+++ b/src/plugins/pgpcore/sgpgme.c
@@ -401,15 +401,7 @@ gpgme_data_t sgpgme_data_from_mimeinfo(MimeInfo *mimeinfo)
 	if (!fp) 
 		return NULL;
 
-	tmp_file = get_tmp_file();
-	copy_file_part(fp, mimeinfo->offset, mimeinfo->length, tmp_file);
-	fclose(fp);
-	fp = NULL;
-	debug_print("tmp file %s\n", tmp_file);
-	
-	err = gpgme_data_new_from_file(&data, tmp_file, 1);
-	claws_unlink(tmp_file);
-	g_free(tmp_file);
+	err = gpgme_data_new_from_filepart(&data, NULL, fp, mimeinfo->offset, mimeinfo->length);
 
 	debug_print("data %p (%d %d)\n", (void *)&data, mimeinfo->offset, mimeinfo->length);
 	if (err) {

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list