aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-02-01 09:44:52 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2006-02-01 09:44:52 +0000
commit40aad2d473656d1ec2a98ed9ebaa9a04d53258d4 (patch)
tree714de236848ecbd95febbb1eaa1a7a47b6ed4ef2
parentabdc34e3204fb13fd438764ae47d87df4971d9cc (diff)
trim too long IMAP4 response lines.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@956 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja5
-rw-r--r--libsylph/imap.c15
3 files changed, 22 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7670e255..e67f8357 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
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.
2006-02-01
diff --git a/ChangeLog.ja b/ChangeLog.ja
index da46e4b7..5ae20e47 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,5 +1,10 @@
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));