aboutsummaryrefslogtreecommitdiff
path: root/libsylph/imap.c
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 /libsylph/imap.c
parentabdc34e3204fb13fd438764ae47d87df4971d9cc (diff)
trim too long IMAP4 response lines.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@956 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'libsylph/imap.c')
-rw-r--r--libsylph/imap.c15
1 files changed, 12 insertions, 3 deletions
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));