Fix for balsa



I have written a patch for balsa-git.

This patch fixes the following issues:

*) if balsa is compiled without SSL support, it gets hanged when trying to connect to an SSL account
   - it fallbacks to non-SSL which is conceptually wrong because port may change if not in tls mode.
   - with this patch it just dont loads the account
*) fixes a memory corruption issue that was making balsa crash when connecting to a server fails.
*) Fix autogen.sh (needs mkdir m4 and create an empty file)
*) The second patch fixes a packing issue in the account configuration wizard.

Let me know your feedback on the patches.. I already sent another mail asking for the project activity
state, so I'm not going to push more patches until I know that somebody is going to review and commit
them.

I would open a bugzilla for each of those bugs, but I think it's just few lines of patch and don't want
to pollute the bug tracker if it's not reviewed.

--pancake
diff --git a/autogen.sh b/autogen.sh
index e7e7884..a5c48aa 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,6 @@
 #! /bin/sh
+mkdir -p m4
+:> gnome-doc-utils.make
 # bootstrap file to be used when autogen.sh fails.
 echo "Running gettextize...  Ignore non-fatal messages."
 glib-gettextize --force --copy || exit 1
diff --git a/libbalsa/imap-server.c b/libbalsa/imap-server.c
index a24c3b3..c6b0536 100644
--- a/libbalsa/imap-server.c
+++ b/libbalsa/imap-server.c
@@ -45,11 +45,7 @@
 #include "imap-commands.h"
 #include <glib/gi18n.h>
 
-#ifdef USE_TLS
 #define REQ_SSL(s) (LIBBALSA_SERVER(s)->use_ssl)
-#else
-#define REQ_SSL(s) (0)
-#endif
 
 /** wait 60 seconds for packets */
 #define IMAP_CMD_TIMEOUT (60*1000)
@@ -661,7 +657,7 @@ libbalsa_imap_server_get_handle(LibBalsaImapServer *imap_server, GError **err)
     struct handle_info *info = NULL;
     ImapResult rc;
 
-    if (imap_server->offline_mode)
+    if (!imap_server || imap_server->offline_mode)
         return NULL;
 
     LOCK_SERVER(imap_server);
diff --git a/libbalsa/imap/imap-handle.c b/libbalsa/imap/imap-handle.c
index 1253697..3922217 100644
--- a/libbalsa/imap/imap-handle.c
+++ b/libbalsa/imap/imap-handle.c
@@ -1019,10 +1019,10 @@ imap_mbox_handle_finalize(GObject* gobject)
   mbox_view_dispose(&handle->mbox_view);
   imap_mbox_resize_cache(handle, 0);
   g_free(handle->msg_cache); handle->msg_cache = NULL;
-  g_array_free(handle->flag_cache, TRUE);
+  g_array_free(handle->flag_cache, TRUE); handle->flag_cache = NULL;
   g_list_foreach(handle->acls, (GFunc)imap_user_acl_free, NULL);
-  g_list_free(handle->acls);
-  g_free(handle->quota_root);
+  g_list_free(handle->acls); handle->acls = NULL;
+  g_free(handle->quota_root); handle->quota_root = NULL;
 
   HANDLE_UNLOCK(handle);
 #if defined(BALSA_USE_THREADS)
diff --git a/libbalsa/imap/libimap.h b/libbalsa/imap/libimap.h
index e087d81..2b3ab6e 100644
--- a/libbalsa/imap/libimap.h
+++ b/libbalsa/imap/libimap.h
@@ -32,15 +32,15 @@ typedef enum {
 
 
 typedef enum {
-  IMAP_SUCCESS = 0,  /* action succeeded*/
+  IMAP_SUCCESS = 0,    /* action succeeded*/
   IMAP_NOMEM,          /* no memory */
   IMAP_CONNECT_FAILED, /* transport level connect failed */
   IMAP_PROTOCOL_ERROR, /* usually unexpected server response */
-  IMAP_AUTH_FAILURE, /* authentication failure */
+  IMAP_AUTH_FAILURE,   /* authentication failure */
   IMAP_AUTH_CANCELLED, /* authentication cancelled, do not retry */
-  IMAP_AUTH_UNAVAIL, /* no supported authentication method available */
-  IMAP_UNSECURE,     /* secure connection was requested but could not
-                      * be established. */
+  IMAP_AUTH_UNAVAIL,   /* no supported authentication method available */
+  IMAP_UNSECURE,       /* secure connection was requested but could not
+                        * be established. */
   IMAP_SELECT_FAILED /* SELECT command failed */
 } ImapResult;
 
diff --git a/src/balsa-index.c b/src/balsa-index.c
index efb8ef1..7af83c6 100644
--- a/src/balsa-index.c
+++ b/src/balsa-index.c
@@ -1034,8 +1034,11 @@ balsa_index_load_mailbox_node (BalsaIndex * index,
         balsa_mblist_close_lru_peer_mbx(balsa_app.mblist, mailbox);
     } while(try_cnt++<3);
 
     if (!successp)
-	return TRUE;
+	return FALSE;
 
     /*
      * set the new mailbox
diff --git a/src/main.c b/src/main.c
index f073e45..4cb44d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -726,7 +726,6 @@ initial_open_inbox()
 void
 balsa_get_stats(long *unread, long *unsent)
 {
-    
     if(balsa_app.inbox && libbalsa_mailbox_open(balsa_app.inbox, NULL) ) {
         /* set threading type to load messages */
         gdk_threads_enter();
diff --git a/libinit_balsa/assistant_page_user.c b/libinit_balsa/assistant_page_user.c
index 4680928..8635538 100644
--- a/libinit_balsa/assistant_page_user.c
+++ b/libinit_balsa/assistant_page_user.c
@@ -87,7 +87,7 @@ balsa_druid_page_user_init(BalsaDruidPageUser * user,
 #endif
     label = GTK_LABEL(gtk_label_new(_(header2)));
     gtk_label_set_line_wrap(label, TRUE);
-    gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(label), TRUE, TRUE, 0);
+    gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(label), FALSE, TRUE, 0);
 
     table = GTK_TABLE(gtk_table_new(10, 2, FALSE));
 
@@ -151,8 +151,7 @@ balsa_druid_page_user_init(BalsaDruidPageUser * user,
                                &(user->localmaildir));
     g_free(preset);
 #endif
-    gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(table), TRUE, TRUE,
-                       8);
+    gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(table), FALSE, FALSE, 8);
 
     user->need_set = FALSE;
 }


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