# HG changeset patch # User Adam Fritzler # Date 995238528 0 # Node ID c0994df574434d6a9849e3e8af9400165ea54ac4 # Parent 711d0115bf1e3e495309f1295a22999a6f5c49a9 [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 diff -r 711d0115bf1e -r c0994df57443 plugins/msn/msn.c --- 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: ");