comparison src/protocols/msn/msn.c @ 2169:b7807144bf44

[gaim-migrate @ 2179] better reading committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 27 Aug 2001 04:53:19 +0000
parents edf8c5a70e5b
children c24595d3c364
comparison
equal deleted inserted replaced
2168:74947d32d3c6 2169:b7807144bf44
728 } 728 }
729 } else if (!g_strncasecmp(buf, "MSG", 3)) { 729 } else if (!g_strncasecmp(buf, "MSG", 3)) {
730 char *user, *tmp = buf; 730 char *user, *tmp = buf;
731 int length; 731 int length;
732 char *msg, *skiphead, *utf, *final; 732 char *msg, *skiphead, *utf, *final;
733 int len; 733 int len, r;
734 734
735 GET_NEXT(tmp); 735 GET_NEXT(tmp);
736 user = tmp; 736 user = tmp;
737 737
738 GET_NEXT(tmp); 738 GET_NEXT(tmp);
740 GET_NEXT(tmp); 740 GET_NEXT(tmp);
741 length = atoi(tmp); 741 length = atoi(tmp);
742 742
743 msg = g_new0(char, MAX(length + 1, MSN_BUF_LEN)); 743 msg = g_new0(char, MAX(length + 1, MSN_BUF_LEN));
744 744
745 if (read(md->fd, msg, length) != length) { 745 for (len = 0; len < length; len += r) {
746 g_free(msg); 746 if ((r = read(md->fd, msg+len, length-len)) <= 0) {
747 hide_login_progress(gc, "Unable to read message"); 747 g_free(msg);
748 signoff(gc); 748 hide_login_progress(gc, "Unable to read message");
749 return; 749 signoff(gc);
750 return;
751 }
750 } 752 }
751 753
752 if (!g_strcasecmp(user, "hotmail")) { 754 if (!g_strcasecmp(user, "hotmail")) {
753 handle_hotmail(gc, msg); 755 handle_hotmail(gc, msg);
754 g_free(msg); 756 g_free(msg);