[Commits] [SCM] claws branch, master, updated. 3.9.2-129-g52b48f6

colin at claws-mail.org colin at claws-mail.org
Sun Dec 8 10:33:42 CET 2013


The branch master of project "claws" (Claws Mail) has been updated
       via  52b48f6cc7a7b0c4e2f51b75e4249a1647ccd896 (commit)
      from  76d08bcbc5cce95e3e546cc718b71e4e972035e0 (commit)


- Log -----------------------------------------------------------------
commit 52b48f6cc7a7b0c4e2f51b75e4249a1647ccd896
Author: Colin Leroy <colin at colino.net>
Date:   Sun Dec 8 10:32:48 2013 +0100

    Fix assertion (port != NULL) in password_get() for
    POP3 sessions, where the password is retrieved prior
    to the session being connected.

diff --git a/src/inc.c b/src/inc.c
index c9ce084..254e52e 100644
--- a/src/inc.c
+++ b/src/inc.c
@@ -531,6 +531,18 @@ static void inc_session_destroy(IncSession *session)
 	g_free(session);
 }
 
+static gint pop3_get_port(Pop3Session *pop3_session)
+{
+#ifdef USE_GNUTLS
+	return pop3_session->ac_prefs->set_popport ?
+		pop3_session->ac_prefs->popport :
+		pop3_session->ac_prefs->ssl_pop == SSL_TUNNEL ? 995 : 110;
+#else
+	return pop3_session->ac_prefs->set_popport ?
+		pop3_session->ac_prefs->popport : 110;
+#endif
+}
+
 static gint inc_start(IncProgressDialog *inc_dialog)
 {
 	IncSession *session;
@@ -552,9 +564,10 @@ static gint inc_start(IncProgressDialog *inc_dialog)
 		session = qlist->data;
 		pop3_session = POP3_SESSION(session->session); 
 		pop3_session->user = g_strdup(pop3_session->ac_prefs->userid);
+
 		if (password_get(pop3_session->user,
 					pop3_session->ac_prefs->recv_server,
-					"pop3", SESSION(session)->port,
+					"pop3", pop3_get_port(pop3_session),
 					&(pop3_session->pass))) {
 			/* NOP */;
 		} else if (pop3_session->ac_prefs->passwd)
@@ -789,10 +802,9 @@ static IncState inc_pop3_session_do(IncSession *session)
 
 	server = pop3_session->ac_prefs->recv_server;
 	account_name = pop3_session->ac_prefs->account_name;
+	port = pop3_get_port(pop3_session);
+
 #ifdef USE_GNUTLS
-	port = pop3_session->ac_prefs->set_popport ?
-		pop3_session->ac_prefs->popport :
-		pop3_session->ac_prefs->ssl_pop == SSL_TUNNEL ? 995 : 110;
 	SESSION(pop3_session)->ssl_type = pop3_session->ac_prefs->ssl_pop;
 	if (pop3_session->ac_prefs->ssl_pop != SSL_NONE)
 		SESSION(pop3_session)->nonblocking =
@@ -811,8 +823,6 @@ static IncState inc_pop3_session_do(IncSession *session)
 			  G_ALERTDEFAULT) != G_ALERTALTERNATE)
 			return INC_CANCEL;
 	}
-	port = pop3_session->ac_prefs->set_popport ?
-		pop3_session->ac_prefs->popport : 110;
 #endif
 
 	buf = g_strdup_printf(_("Account '%s': Connecting to POP3 server: %s:%d..."),

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

Summary of changes:
 src/inc.c |   22 ++++++++++++++++------
 1 files changed, 16 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list