Mercurial > pidgin
changeset 2070:c0994df57443
[gaim-migrate @ 2080]
loop on read (large messages cause a disconnect without this). [This would happen while talking to SmarterChild(@hotmail.com).]
committer: Tailor Script <tailor@pidgin.im>
author | Adam Fritzler <mid@auk.cx> |
---|---|
date | Sun, 15 Jul 2001 23:08:48 +0000 |
parents | 711d0115bf1e |
children | 0fd338304759 |
files | plugins/msn/msn.c |
diffstat | 1 files changed, 8 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/msn/msn.c Sun Jul 15 19:23:26 2001 +0000 +++ b/plugins/msn/msn.c Sun Jul 15 23:08:48 2001 +0000 @@ -431,7 +431,7 @@ char *user, *tmp = buf; int length; char *msg, *content, *utf; - int len; + int len, r; GET_NEXT(tmp); user = tmp; @@ -443,12 +443,13 @@ msg = g_new0(char, MAX(length + 1, MSN_BUF_LEN)); - if (read(ms->fd, msg, length) != length) { - g_free(msg); - hide_login_progress(gc, "Unable to read message"); - signoff(gc); - return; - + for (len = 0; len < length; len += r) { + if ((r = read(ms->fd, msg+len, length-len)) <= 0) { + g_free(msg); + hide_login_progress(gc, "Unable to read message"); + signoff(gc); + return; + } } content = strstr(msg, "Content-Type: ");