diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-06-13 06:57:51 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-06-13 06:57:51 +0000 |
commit | 0da94eee68f536ad2320edc888c5a2a9b2f3f248 (patch) | |
tree | 547d8236c208cdb3f6618e1109739390b753031d | |
parent | 2ce75a37bcca6a5c960c1fb56b530c24de5a8492 (diff) |
reacquire CAPABILITY after STARTTLS since it can be changed.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@334 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | src/imap.c | 19 |
3 files changed, 24 insertions, 5 deletions
@@ -1,3 +1,8 @@ +2005-06-13 + + * src/imap.c: reacquire CAPABILITY after STARTTLS since it can be + changed (thanks to Tomasz). + 2005-06-10 * replaced every strcasecmp/g_strcasecmp with g_ascii_strcasecmp, diff --git a/ChangeLog.ja b/ChangeLog.ja index f9ea407c..0e3556cb 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2005-06-13 + + * src/imap.c: STARTTLS の後 CAPABILITY が変更される可能性があるため、 + STARTTLS の後再取得するようにした(Tomasz さん thanks)。 + 2005-06-10 * すべての strcasecmp/g_strcasecmp を g_ascii_strcasecmp で、 @@ -561,8 +561,10 @@ static Session *imap_session_new(PrefsAccount *account) SESSION(session)->destroy = imap_session_destroy; session->authenticated = FALSE; - session->mbox = NULL; - session->cmd_count = 0; + session->capability = NULL; + session->uidplus = FALSE; + session->mbox = NULL; + session->cmd_count = 0; session_list = g_list_append(session_list, session); @@ -630,6 +632,10 @@ static gint imap_session_connect(IMAPSession *session) } if (!ssl_init_socket_with_method(sock, SSL_METHOD_TLSv1)) return IMAP_SOCKET; + + /* capability can be changed after STARTTLS */ + if (imap_cmd_capability(session) != IMAP_SUCCESS) + return IMAP_ERROR; } #endif @@ -3033,8 +3039,10 @@ static gboolean imap_has_capability(IMAPSession *session, static void imap_capability_free(IMAPSession *session) { - g_strfreev(session->capability); - session->capability = NULL; + if (session->capability) { + g_strfreev(session->capability); + session->capability = NULL; + } } @@ -3058,7 +3066,8 @@ static gint imap_cmd_capability(IMAPSession *session) capability += strlen("CAPABILITY "); - IMAP_SESSION(session)->capability = g_strsplit(capability, " ", -1); + imap_capability_free(session); + session->capability = g_strsplit(capability, " ", -1); catch: ptr_array_free_strings(argbuf); |