You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(61) |
Feb
(111) |
Mar
(98) |
Apr
(33) |
May
(31) |
Jun
(64) |
Jul
(35) |
Aug
(50) |
Sep
(170) |
Oct
(89) |
Nov
(72) |
Dec
(214) |
2002 |
Jan
(74) |
Feb
(21) |
Mar
(5) |
Apr
(4) |
May
(61) |
Jun
(13) |
Jul
(3) |
Aug
(39) |
Sep
(14) |
Oct
(80) |
Nov
(22) |
Dec
(76) |
2003 |
Jan
(14) |
Feb
(59) |
Mar
(7) |
Apr
(5) |
May
|
Jun
(4) |
Jul
(6) |
Aug
(78) |
Sep
(68) |
Oct
(23) |
Nov
(25) |
Dec
(107) |
2004 |
Jan
(82) |
Feb
(75) |
Mar
(13) |
Apr
(9) |
May
(21) |
Jun
(2) |
Jul
(1) |
Aug
(52) |
Sep
(23) |
Oct
(15) |
Nov
(6) |
Dec
(60) |
2005 |
Jan
(125) |
Feb
(94) |
Mar
(32) |
Apr
(68) |
May
|
Jun
|
Jul
(11) |
Aug
(3) |
Sep
(15) |
Oct
(3) |
Nov
|
Dec
(58) |
2006 |
Jan
(46) |
Feb
(29) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(9) |
Dec
(9) |
2007 |
Jan
(62) |
Feb
(60) |
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(2) |
Nov
(4) |
Dec
(46) |
2008 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(10) |
Dec
(49) |
2009 |
Jan
(14) |
Feb
(12) |
Mar
(37) |
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(25) |
Oct
(48) |
Nov
(7) |
Dec
(45) |
2010 |
Jan
(15) |
Feb
(14) |
Mar
(7) |
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
(1) |
Sep
|
Oct
(28) |
Nov
|
Dec
(44) |
2011 |
Jan
(22) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(70) |
2012 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(128) |
2013 |
Jan
(8) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(2) |
Dec
(150) |
2014 |
Jan
(70) |
Feb
(44) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Sebastian B. <sb...@us...> - 2013-12-24 09:33:36
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1626 Modified Files: imap.c Log Message: The path variable was not initialized. Fixed. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- imap.c 24 Dec 2013 09:33:19 -0000 1.87 +++ imap.c 24 Dec 2013 09:33:34 -0000 1.88 @@ -2341,6 +2341,7 @@ /* At first copy the mail to a temporary location because we may store the emails which only has a \n ending */ if (!(tfh = tmpfile())) return 0; + getcwd(path, sizeof(path)); if (chdir(source_dir) == -1) { fclose(tfh); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:33:21
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1596 Modified Files: imap.c Log Message: Doxygenifized two functions. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- imap.c 24 Dec 2013 09:33:03 -0000 1.86 +++ imap.c 24 Dec 2013 09:33:19 -0000 1.87 @@ -2233,9 +2233,15 @@ return success; } -/************************************************************************** - Delete a mail permanently. Thread version. -**************************************************************************/ +/** + * Delete a mail permanently from the server + * + * @param filename + * @param server + * @param folder + * @return success or not. + * @note This function can only be called in the context of the imap thread. + */ static int imap_thread_delete_mail_by_filename(char *filename, struct imap_server *server, struct folder *folder) { char send[200]; @@ -2295,9 +2301,17 @@ return success; } -/************************************************************************** - Store a mail. Thread version. -**************************************************************************/ +/** + * Store the mail represented by the mail located in the given source_dir + * on the given server in the given dest_folder. + * + * @param mail + * @param source_dir + * @param server + * @param dest_folder + * @return success or not. + * @note This function can only be called in the context of the imap thread. + */ static int imap_thread_append_mail(struct mail_info *mail, char *source_dir, struct imap_server *server, struct folder *dest_folder) { char send[200]; |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:33:06
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1531 Modified Files: imap.c Log Message: The mail name should begin with the u letter to be a uid Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- imap.c 24 Dec 2013 09:32:46 -0000 1.85 +++ imap.c 24 Dec 2013 09:33:03 -0000 1.86 @@ -125,7 +125,7 @@ /* fill in the uids of the mails */ for (i=0;i < num_of_mails;i++) { - if (folder->mail_info_array[i]) + if (folder->mail_info_array[i] && folder->mail_info_array[i]->filename[0] == 'u') { local_mail_array[i].uid = atoi(folder->mail_info_array[i]->filename + 1); local_mail_array[i].todel = mail_is_marked_as_deleted(folder->mail_info_array[i]); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:32:48
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1492 Modified Files: imap.c Log Message: Use the correct remote mail array. The previously used one has already been freed when being at this point. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- imap.c 24 Dec 2013 09:32:28 -0000 1.84 +++ imap.c 24 Dec 2013 09:32:46 -0000 1.85 @@ -1793,7 +1793,7 @@ if (rm) { /* Now delete orphaned messages */ - imap_delete_orphan_messages(local_mail_array,num_of_local_mails,remote_mail_array,num_remote_mails, imap_server, imap_folder); + imap_delete_orphan_messages(local_mail_array,num_of_local_mails,rm->remote_mail_array,rm->num_of_remote_mail, imap_server, imap_folder); imap_free_remote_mailbox(rm); } } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:32:32
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1455 Modified Files: imap.c simplemail.c Log Message: Logging added. Index: simplemail.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/simplemail.c,v retrieving revision 1.233 retrieving revision 1.234 diff -u -d -r1.233 -r1.234 --- simplemail.c 24 Dec 2013 09:31:05 -0000 1.233 +++ simplemail.c 24 Dec 2013 09:32:28 -0000 1.234 @@ -320,11 +320,14 @@ mail = folder_imap_find_mail_by_uid(f, uid); if (!mail) { + SM_DEBUGF(20, ("Couldn't find mail with uid %u\n", uid)); folder_unlock(f); folders_unlock(); return; } + SM_DEBUGF(20, ("Deleting local mail for %s@server://%s with uid %u\n", user, server, path, uid)); + folder_move_mail(f,folder_deleted(),mail); main_refresh_folder(f); main_refresh_folder(folder_deleted()); Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- imap.c 24 Dec 2013 09:31:23 -0000 1.83 +++ imap.c 24 Dec 2013 09:32:28 -0000 1.84 @@ -147,6 +147,8 @@ *num_of_todel_mails_ptr = num_of_todel_mails; } folder_unlock(folder); + + SM_DEBUGF(20, ("num_of_mails=%d, num_of_todel_mails=%d\n", num_of_mails, num_of_todel_mails)); SM_RETURN(success,"%d"); return success; } @@ -166,6 +168,7 @@ int i,j; SM_ENTER; + SM_DEBUGF(20,("num_of_local_mails=%d, num_remote_mails=%d\n", num_of_local_mails, num_remote_mails)); i = j = 0; while (i<num_of_local_mails && j<num_remote_mails) |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:32:12
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1302/tests Modified Files: imap2_unittest.c Log Message: More stubs added. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- imap2_unittest.c 24 Dec 2013 09:30:16 -0000 1.19 +++ imap2_unittest.c 24 Dec 2013 09:32:10 -0000 1.20 @@ -99,6 +99,14 @@ { } +void main_freeze_mail_list(void) +{ +} + +void main_thaw_mail_list(void) +{ +} + void read_refresh_prevnext_button(struct folder *f) { } @@ -142,7 +150,13 @@ break; case QUIT: - thread_abort(thread_get_main()); + { + struct folder *f; + f = folder_find_by_imap("test","localhost","INBOX"); + CU_ASSERT(f != NULL); + folder_save_index(f); + thread_abort(thread_get_main()); + } break; } return NULL; |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:31:56
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1135/gtk Modified Files: arch.h Log Message: Changed definition of SM_CURRENT_DIR to dot. Index: arch.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/arch.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- arch.h 9 Jan 2011 20:11:38 -0000 1.2 +++ arch.h 24 Dec 2013 09:31:54 -0000 1.3 @@ -27,7 +27,7 @@ #define SM_DIR "" #define SM_CHARSET_DIR "Charsets" #define SM_FOLDER_DIR ".folders" -#define SM_CURRENT_DIR "" +#define SM_CURRENT_DIR "." /* Operation system */ #define SM_OPERATIONSYSTEM "UNIX/GTK+" |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:31:41
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1110/gtk Modified Files: support.c Log Message: Improved sm_convert_seconds(). Index: support.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/support.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- support.c 24 Dec 2013 08:52:07 -0000 1.15 +++ support.c 24 Dec 2013 09:31:38 -0000 1.16 @@ -228,7 +228,8 @@ *******************************************************************/ void sm_convert_seconds(unsigned int seconds, struct tm *tm) { - memset(tm,0,sizeof(*tm)); + time_t t = seconds; + localtime_r(&t, tm); } /****************************************************************** |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:31:25
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1082 Modified Files: imap.c Log Message: Added enter/leave debug logging. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- imap.c 24 Dec 2013 09:30:49 -0000 1.82 +++ imap.c 24 Dec 2013 09:31:23 -0000 1.83 @@ -165,6 +165,8 @@ { int i,j; + SM_ENTER; + i = j = 0; while (i<num_of_local_mails && j<num_remote_mails) { @@ -190,6 +192,8 @@ unsigned int local_uid = local_mail_array[i].uid; if (local_uid) thread_call_parent_function_sync(NULL,callback_delete_mail_by_uid,4,imap_server->login,imap_server->name,imap_folder,local_uid); } + + SM_LEAVE; } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:31:08
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1042 Modified Files: simplemail.c Log Message: Function callback_new_mail_to_folder() will now also copy the mail to the imap server. Index: simplemail.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/simplemail.c,v retrieving revision 1.232 retrieving revision 1.233 diff -u -d -r1.232 -r1.233 --- simplemail.c 2 Jan 2013 17:45:31 -0000 1.232 +++ simplemail.c 24 Dec 2013 09:31:05 -0000 1.233 @@ -1395,6 +1395,12 @@ main_refresh_folder(folder); read_refresh_prevnext_button(folder); + + /* TODO: Perhaps it would be better to do omit the previous copy operation if this condition holds */ + if (folder->is_imap) + { + imap_append_mail(mail, folder->path, folder); + } } chdir(buf); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:30:51
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv1004 Modified Files: imap.c Log Message: Added some logging. Index: imap.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/imap.c,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- imap.c 24 Dec 2013 09:17:39 -0000 1.81 +++ imap.c 24 Dec 2013 09:30:49 -0000 1.82 @@ -112,6 +112,8 @@ void *handle = NULL; int i,success = 0; + SM_ENTER; + folder_lock(folder); folder_next_mail(folder,&handle); @@ -145,6 +147,7 @@ *num_of_todel_mails_ptr = num_of_todel_mails; } folder_unlock(folder); + SM_RETURN(success,"%d"); return success; } @@ -560,9 +563,14 @@ int success = 0; struct remote_mail *remote_mail_array = NULL; + SM_ENTER; + struct remote_mailbox *rm; if (!(rm = imap_select_mailbox(conn,path,writemode))) + { + SM_RETURN(NULL,"%p"); return NULL; + } if (!uid_start) uid_end = 0; else if (!uid_end) uid_start = 0; @@ -701,6 +709,7 @@ rm->remote_mail_array = remote_mail_array; rm->num_of_remote_mail = num_of_remote_mails; } + SM_RETURN(rm, "%p"); return rm; } @@ -1575,10 +1584,20 @@ struct progmon *pm; - if (!imap_connection) return -1; + SM_ENTER; + + if (!imap_connection) + { + SM_RETURN(-1,"%d"); + return -1; + } getcwd(path, sizeof(path)); - if (chdir(imap_local_path) == -1) return -1; + if (chdir(imap_local_path) == -1) + { + SM_RETURN(-1,"%d"); + return -1; + } SM_DEBUGF(10,("Downloading mails of folder \"%s\"\n",imap_folder)); @@ -1799,7 +1818,7 @@ thread_call_parent_function_async_string(status_set_status,1,path); } - + SM_RETURN(downloaded_mails,"%d"); return downloaded_mails; } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:30:35
|
Update of /cvsroot/simplemail/simplemail/tests/dovecot-conf/conf.d In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv979/tests/dovecot-conf/conf.d Modified Files: 10-auth.conf Log Message: Allow plaintext auth. We use this for testing only. Index: 10-auth.conf =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/dovecot-conf/conf.d/10-auth.conf,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- 10-auth.conf 24 Dec 2013 09:06:40 -0000 1.2 +++ 10-auth.conf 24 Dec 2013 09:30:33 -0000 1.3 @@ -8,6 +8,7 @@ # connection is considered secure and plaintext authentication is allowed. # See also ssl=required setting. #disable_plaintext_auth = yes +disable_plaintext_auth = no # Authentication cache size (e.g. 10M). 0 means it's disabled. Note that # bsdauth, PAM and vpopmail require cache_key to be set for caching to be used. |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:30:19
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv953/tests Modified Files: imap2_unittest.c Log Message: Use absolute directory for the test profile. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- imap2_unittest.c 24 Dec 2013 09:29:59 -0000 1.18 +++ imap2_unittest.c 24 Dec 2013 09:30:16 -0000 1.19 @@ -154,10 +154,15 @@ struct account *ac; struct folder *f; + char *imap_profile; + debug_init(); debug_set_level(25); - config_set_user_profile_directory("imap-profile"); + imap_profile = realpath("imap-profile", NULL); + CU_ASSERT(imap_profile != NULL); + + config_set_user_profile_directory(imap_profile); CU_ASSERT(codesets_init() != 0); @@ -207,6 +212,8 @@ free_config(); progmon_deinit(); codesets_cleanup(); + + free(imap_profile); } /*************************************************************/ |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:30:02
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv874/tests Modified Files: imap2_unittest.c Log Message: Add a mail to the imap folder (locally only for now) Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- imap2_unittest.c 24 Dec 2013 09:29:44 -0000 1.17 +++ imap2_unittest.c 24 Dec 2013 09:29:59 -0000 1.18 @@ -110,6 +110,7 @@ static enum { SWITCH_TO_INBOX, + ADD_NEW_MAIL, QUIT } state; @@ -125,6 +126,18 @@ imap_thread_connect(f); } + state = ADD_NEW_MAIL; + break; + + case ADD_NEW_MAIL: + { + char *name = realpath("test.eml", NULL); + struct folder *f; + f = folder_find_by_imap("test","localhost","INBOX"); + CU_ASSERT(f != NULL); + callback_new_mail_to_folder(name, f); + free(name); + } state = QUIT; break; |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:29:46
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv846/tests Modified Files: imap2_unittest.c Log Message: Switch to the INBOX folder in the timer callback. This should download all available mails within the folder. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- imap2_unittest.c 24 Dec 2013 09:29:26 -0000 1.16 +++ imap2_unittest.c 24 Dec 2013 09:29:44 -0000 1.17 @@ -25,7 +25,10 @@ #include "account.h" #include "configuration.h" +#include "debug.h" #include "folder.h" +#include "mail.h" +#include "simplemail.h" #include "support_indep.h" /*************************************************************/ @@ -104,7 +107,31 @@ void *test_imap_timer_callback(void *data) { - thread_abort(thread_get_main()); + static enum + { + SWITCH_TO_INBOX, + QUIT + } state; + + SM_DEBUGF(20,("state = %d\n", state)); + switch (state) + { + case SWITCH_TO_INBOX: + { + struct folder *f; + + f = folder_find_by_imap("test","localhost","INBOX"); + CU_ASSERT(f != NULL); + + imap_thread_connect(f); + } + state = QUIT; + break; + + case QUIT: + thread_abort(thread_get_main()); + break; + } return NULL; } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:29:29
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv825/tests Modified Files: imap2_unittest.c Log Message: Cleanup the threads even more earlier. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- imap2_unittest.c 24 Dec 2013 09:29:11 -0000 1.15 +++ imap2_unittest.c 24 Dec 2013 09:29:26 -0000 1.16 @@ -162,9 +162,9 @@ thread_wait(test_imap_timer_callback, NULL, 2000); + cleanup_threads(); del_folders(); free_config(); - cleanup_threads(); progmon_deinit(); codesets_cleanup(); } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:29:13
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv777/tests Modified Files: imap2_unittest.c Log Message: Added some function stubs. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- imap2_unittest.c 24 Dec 2013 09:27:45 -0000 1.14 +++ imap2_unittest.c 24 Dec 2013 09:29:11 -0000 1.15 @@ -87,6 +87,19 @@ { } +struct folder *main_get_folder(void) +{ + return NULL; +} + +void main_refresh_folder(struct folder *f) +{ +} + +void read_refresh_prevnext_button(struct folder *f) +{ +} + /*************************************************************/ void *test_imap_timer_callback(void *data) |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:28:55
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv725/gtk Modified Files: subthreads.c Log Message: Use recursive mutexes for the semaphores. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- subthreads.c 24 Dec 2013 09:28:36 -0000 1.59 +++ subthreads.c 24 Dec 2013 09:28:53 -0000 1.60 @@ -695,7 +695,7 @@ struct semaphore_s { - GMutex *mutex; + GStaticRecMutex mutex; }; semaphore_t thread_create_semaphore(void) @@ -703,32 +703,27 @@ semaphore_t sem = malloc(sizeof(struct semaphore_s)); if (sem) { - if (!(sem->mutex = g_mutex_new())) - { - free(sem); - return NULL; - } + g_static_rec_mutex_init(&sem->mutex); } return sem; } void thread_dispose_semaphore(semaphore_t sem) { - g_mutex_free(sem->mutex); free(sem); } void thread_lock_semaphore(semaphore_t sem) { - g_mutex_lock(sem->mutex); + g_static_rec_mutex_lock(&sem->mutex); } int thread_attempt_lock_semaphore(semaphore_t sem) { - return g_mutex_trylock(sem->mutex); + return g_static_rec_mutex_trylock(&sem->mutex); } void thread_unlock_semaphore(semaphore_t sem) { - g_mutex_unlock(sem->mutex); + g_static_rec_mutex_unlock(&sem->mutex); } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:28:38
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv693/gtk Modified Files: subthreads.c Log Message: When doing sync calls, no longer use g_main_run_loop() and g_main_loop_quit(). Instead use blocking g_main_context_iteration() and an own flag variable. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- subthreads.c 24 Dec 2013 09:28:20 -0000 1.58 +++ subthreads.c 24 Dec 2013 09:28:36 -0000 1.59 @@ -286,13 +286,25 @@ uintptr_t rc; thread_t caller; + + /** Indicates that the call has been done */ + int done; }; +static gboolean thread_call_function_sync_done_entry(gpointer user_data) +{ + struct thread_call_function_sync_data *data = (struct thread_call_function_sync_data*)user_data; + data->done = 1; + return 0; +} + /* FIXME: Note that if the args are not passed in a register, but e.g., on the stack this doesn't need to * work depending on the ABI */ static gboolean thread_call_function_sync_entry(gpointer user_data) { + SM_ENTER; + struct thread_call_function_sync_data *data = (struct thread_call_function_sync_data*)user_data; uintptr_t rc; @@ -307,8 +319,10 @@ case 6: rc = ((int (*)(void*,void*,void*,void*,void*,void*))data->function)(data->arg[0],data->arg[1],data->arg[2],data->arg[3],data->arg[4],data->arg[5]);break; } data->rc = rc; - g_main_loop_quit(data->caller->main_loop); + g_main_context_invoke(data->caller->context, thread_call_function_sync_done_entry, data); + + SM_LEAVE; return 0; } @@ -328,18 +342,22 @@ int i; SM_ENTER; + SM_DEBUGF(20,("Thread %p calls on context for %p\n", thread_get(), thread)); assert(argcount < THREAD_CALL_FUNCTION_SYNC_DATA_NUM_ARGS); data.function = (int (*)(void))function; data.argcount = argcount; data.caller = thread_get(); + data.done = 0; for (i=0; i < argcount; i++) data.arg[i] = va_arg(argptr, void *); g_main_context_invoke(thread->context, thread_call_function_sync_entry, &data); - g_main_loop_run(data.caller->main_loop); + + while (!data.done) + g_main_context_iteration(data.caller->context, 1); if (rc) *rc = data.rc; |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:28:23
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv659/gtk Modified Files: subthreads.c Log Message: Added logging for printing the address of the new thread. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- subthreads.c 24 Dec 2013 09:28:01 -0000 1.57 +++ subthreads.c 24 Dec 2013 09:28:20 -0000 1.58 @@ -183,6 +183,8 @@ struct thread_add_data *tad = (struct thread_add_data*)udata; struct thread_s *t = tad->thread; + SM_DEBUGF(20,("New thread %p\n", t)); + /* TODO: Catch errors and inform parent task */ t->thread = g_thread_self(); t->context = g_main_context_new(); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:28:03
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv617/gtk Modified Files: subthreads.c Log Message: Destroy the timeout source after running the loop. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.56 retrieving revision 1.57 diff -u -d -r1.56 -r1.57 --- subthreads.c 24 Dec 2013 09:27:28 -0000 1.56 +++ subthreads.c 24 Dec 2013 09:28:01 -0000 1.57 @@ -457,6 +457,9 @@ { struct thread_wait_timer_entry_data data; struct thread_s *t; + GSource *s = NULL; + + SM_ENTER; memset(&data, 0, sizeof(data)); @@ -467,7 +470,7 @@ if (timer_callback) { - GSource *s = g_timeout_source_new(millis); + s = g_timeout_source_new(millis); g_source_set_callback(s, thread_wait_timer_entry, &data, NULL); g_source_attach(s, t->context); g_source_unref(s); @@ -475,6 +478,12 @@ g_main_loop_run(t->main_loop); + /* Destroy the timer if there was any */ + if (timer_callback && s) + g_source_destroy(s); + + SM_LEAVE; + return 0; } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:27:47
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv592/tests Modified Files: imap2_unittest.c Log Message: Switched position when progmon and threads are initialized (and cleaned up). Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- imap2_unittest.c 24 Dec 2013 09:26:54 -0000 1.13 +++ imap2_unittest.c 24 Dec 2013 09:27:45 -0000 1.14 @@ -108,8 +108,8 @@ CU_ASSERT(codesets_init() != 0); - CU_ASSERT(init_threads() != 0); CU_ASSERT(progmon_init() != 0); + CU_ASSERT(init_threads() != 0); CU_ASSERT(load_config() != 0); CU_ASSERT(init_folders() != 0); @@ -151,8 +151,8 @@ del_folders(); free_config(); - progmon_deinit(); cleanup_threads(); + progmon_deinit(); codesets_cleanup(); } |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:27:32
|
Update of /cvsroot/simplemail/simplemail/gtk In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv550/gtk Modified Files: subthreads.c Log Message: No longer used g_thread_join() when determining when sub threads finished. Instead, we use the standard main loop when doing the cleanup after we sent an abort to all threads. We then periodically check, whether there are still active threads. This is not the most elegant solution. Index: subthreads.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/gtk/subthreads.c,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- subthreads.c 24 Dec 2013 09:26:38 -0000 1.55 +++ subthreads.c 24 Dec 2013 09:27:28 -0000 1.56 @@ -89,28 +89,57 @@ /***************************************************************************************/ +/** + * Checks if there are still any threads in the thread list and quits the + * main loop if this is not the case. + * + * @param udata + * @return + */ +static gboolean cleanup_threads_timer_callback(gpointer udata) +{ + struct thread_s *t; + + g_mutex_lock(thread_list_mutex); + t = (struct thread_s*)list_first(&thread_list); + g_mutex_unlock(thread_list_mutex); + + if (!t) + g_main_loop_quit(main_thread.main_loop); + return !!t; +} + void cleanup_threads(void) { struct thread_s *t; SM_ENTER; + /* Abort all threads */ + g_mutex_lock(thread_list_mutex); + t = (struct thread_s*)list_first(&thread_list); + while (t) + { + thread_abort(t); + t = (struct thread_s*)node_next(&t->node); + } + g_mutex_unlock(thread_list_mutex); + while (1) { g_mutex_lock(thread_list_mutex); - if ((t = (struct thread_s*)list_first(&thread_list))) - { - GThread *gt; - gt = t->thread; - thread_abort(t); - g_mutex_unlock(thread_list_mutex); - /* FIXME: This could lead to a dead-lock situation if the thread was about to perform a synchronous call */ - g_thread_join(gt); - } else - { - g_mutex_unlock(thread_list_mutex); - break; - } + t = (struct thread_s*)list_first(&thread_list); + g_mutex_unlock(thread_list_mutex); + + if (!t) break; + + GSource *s = g_timeout_source_new(100); + g_source_set_callback(s, cleanup_threads_timer_callback, NULL, NULL); + g_source_attach(s, main_thread.context); + g_source_unref(s); + + /* Dispatch any current events */ + g_main_loop_run(main_thread.main_loop); } g_mutex_free(main_thread.mutex); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:27:14
|
Update of /cvsroot/simplemail/simplemail/indep-include In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv526/indep-include Modified Files: subthreads.h Log Message: Added TODO Index: subthreads.h =================================================================== RCS file: /cvsroot/simplemail/simplemail/indep-include/subthreads.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- subthreads.h 7 Dec 2013 19:39:25 -0000 1.20 +++ subthreads.h 24 Dec 2013 09:27:12 -0000 1.21 @@ -34,6 +34,9 @@ /** * Cleanup the thread system. Will abort every thread. + * + * @todo there should be a separate abort_threads() function which + * aborts all threads (and disallows the creation of new ones) */ void cleanup_threads(void); |
From: Sebastian B. <sb...@us...> - 2013-12-24 09:26:56
|
Update of /cvsroot/simplemail/simplemail/tests In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv488/tests Modified Files: imap2_unittest.c Log Message: Added a 2nd call to imap_thread_connect() for testing purposes. Index: imap2_unittest.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tests/imap2_unittest.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- imap2_unittest.c 24 Dec 2013 09:14:51 -0000 1.12 +++ imap2_unittest.c 24 Dec 2013 09:26:54 -0000 1.13 @@ -143,6 +143,8 @@ f = folder_find_by_name("localhost"); CU_ASSERT(f != NULL); + /* Doing this twice is intended */ + imap_thread_connect(f); imap_thread_connect(f); thread_wait(test_imap_timer_callback, NULL, 2000); |