diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-12 08:46:49 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2005-10-12 08:46:49 +0000 |
commit | 7b0ca5ffe4f2074dce460b501ba70374bebd5f77 (patch) | |
tree | cddb2e0644553b0e77531155719a8389d3407e42 | |
parent | 38511cacbbe75f5d2a68c2679d878ba4f3f3cd28 (diff) |
also log IMAP4 literal strings.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@639 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ChangeLog.ja | 7 | ||||
-rw-r--r-- | libsylph/imap.c | 4 | ||||
-rw-r--r-- | libsylph/recv.c | 6 |
4 files changed, 21 insertions, 2 deletions
@@ -1,5 +1,11 @@ 2005-10-12 + * libsylph/recv.c: recv_bytes(): null-terminate the received data + in case it's a string. + libsylph/imap.c: imap_cmd_ok(): also log literal strings. + +2005-10-12 + * src/alertpanel.c: win32: make dialog in front on focus out. 2005-10-12 diff --git a/ChangeLog.ja b/ChangeLog.ja index 7a7f73f9..bf5ae05d 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,5 +1,12 @@ 2005-10-12 + * libsylph/recv.c: recv_bytes(): 受信したデータを null 終端するように + した(文字列の場合のため)。 + libsylph/imap.c: imap_cmd_ok(): リテラル文字列もログに記録する + ようにした。 + +2005-10-12 + * src/alertpanel.c: win32: focus out のときダイアログを前面にもって くるようにした。 diff --git a/libsylph/imap.c b/libsylph/imap.c index 0f75f73c..38bce92a 100644 --- a/libsylph/imap.c +++ b/libsylph/imap.c @@ -3756,6 +3756,10 @@ static gint imap_cmd_ok(IMAPSession *session, GPtrArray *argbuf) ok = IMAP_SOCKET; break; } + if (memchr(literal, '\n', len)) + log_print("IMAP4< (literal: %d bytes)\n", len); + else + log_print("IMAP4< %s\n", literal); g_string_append(str, "\r\n"); g_string_append_len(str, literal, len); diff --git a/libsylph/recv.c b/libsylph/recv.c index 0b71545c..3d2a7968 100644 --- a/libsylph/recv.c +++ b/libsylph/recv.c @@ -45,19 +45,21 @@ gchar *recv_bytes(SockInfo *sock, glong size) if (size == 0) return NULL; - buf = g_malloc(size); + buf = g_malloc(size + 1); do { gint read_count; read_count = sock_read(sock, buf + count, size - count); - if (read_count < 0) { + if (read_count <= 0) { g_free(buf); return NULL; } count += read_count; } while (count < size); + buf[size] = '\0'; + return buf; } |