From 40aad2d473656d1ec2a98ed9ebaa9a04d53258d4 Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 1 Feb 2006 09:44:52 +0000 Subject: trim too long IMAP4 response lines. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@956 ee746299-78ed-0310-b773-934348b2243d --- ChangeLog | 5 +++++ ChangeLog.ja | 5 +++++ libsylph/imap.c | 15 ++++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7670e255..e67f8357 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-02-01 + + * libsylph/imap.c: imap_cmd_gen_recv(): trim too long lines (ex. + SEARCH command). + 2006-02-01 * src/mainwindow.[ch]: disable Send button if no account exist. diff --git a/ChangeLog.ja b/ChangeLog.ja index da46e4b7..5ae20e47 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2006-02-01 + + * libsylph/imap.c: imap_cmd_gen_recv(): 長すぎる行を切り詰めるように + した(ex. SEARCH コマンド)。 + 2006-02-01 * src/mainwindow.[ch]: アカウントが存在しない場合は送信ボタンを無効に diff --git a/libsylph/imap.c b/libsylph/imap.c index ceffb2c0..fd79454a 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c @@ -3803,7 +3803,7 @@ static gint imap_cmd_ok(IMAPSession *session, GPtrArray *argbuf) &cmd_num, cmd_status) < 2) { ok = IMAP_ERROR; } else if (cmd_num == session->cmd_count && - !strcmp(cmd_status, "OK")) { + !strcmp(cmd_status, "OK")) { if (argbuf) g_ptr_array_add(argbuf, g_strdup(str->str)); } else { @@ -3843,12 +3843,21 @@ static void imap_cmd_gen_send(IMAPSession *session, const gchar *format, ...) static gint imap_cmd_gen_recv(IMAPSession *session, gchar **ret) { - if (sock_getline(SESSION(session)->sock, ret) < 0) + gint len; + + if ((len = sock_getline(SESSION(session)->sock, ret)) < 0) return IMAP_SOCKET; strretchomp(*ret); - log_print("IMAP4< %s\n", *ret); + if (len > 1000) { + gchar *str; + + str = trim_string(*ret, 1000); + log_print("IMAP4< %s\n", str); + g_free(str); + } else + log_print("IMAP4< %s\n", *ret); session_set_access_time(SESSION(session)); -- cgit v1.2.3