Mercurial > pidgin.yaz
comparison src/protocols/oscar/ft.c @ 4895:9e50494f63a1
[gaim-migrate @ 5227]
IM image support.
javabsp did most of the hard work, I just cleaned it up and fixed the bugs ;-)
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Wed, 26 Mar 2003 06:19:44 +0000 |
parents | 26837f462a66 |
children | 6c02ee2b471d |
comparison
equal
deleted
inserted
replaced
4894:eea963dcd1ed | 4895:9e50494f63a1 |
---|---|
670 int recvd = 0; | 670 int recvd = 0; |
671 int i, isawaymsg; | 671 int i, isawaymsg; |
672 | 672 |
673 isawaymsg = flags & 0x0001; | 673 isawaymsg = flags & 0x0001; |
674 | 674 |
675 if (!(msg = calloc(1, payloadlength+1))) | 675 if (!(msg = calloc(1, payloadlength+1))) { |
676 free(snptr); | |
676 return -ENOMEM; | 677 return -ENOMEM; |
678 } | |
677 | 679 |
678 while (payloadlength - recvd) { | 680 while (payloadlength - recvd) { |
679 if (payloadlength - recvd >= 1024) | 681 if (payloadlength - recvd >= 1024) |
680 i = aim_recv(conn->fd, &msg[recvd], 1024); | 682 i = aim_recv(conn->fd, &msg[recvd], 1024); |
681 else | 683 else |
682 i = aim_recv(conn->fd, &msg[recvd], payloadlength - recvd); | 684 i = aim_recv(conn->fd, &msg[recvd], payloadlength - recvd); |
683 if (i <= 0) { | 685 if (i <= 0) { |
684 free(msg); | 686 free(msg); |
687 free(snptr); | |
685 return -1; | 688 return -1; |
686 } | 689 } |
687 recvd = recvd + i; | 690 recvd = recvd + i; |
688 if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER))) | 691 if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_IMAGETRANSFER))) |
689 ret = userfunc(sess, &fr, snptr, (double)recvd / payloadlength); | 692 ret = userfunc(sess, &fr, snptr, (double)recvd / payloadlength); |
692 if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING))) | 695 if ((userfunc = aim_callhandler(sess, conn, AIM_CB_FAM_OFT, AIM_CB_OFT_DIRECTIMINCOMING))) |
693 ret = userfunc(sess, &fr, snptr, msg, payloadlength, encoding, isawaymsg); | 696 ret = userfunc(sess, &fr, snptr, msg, payloadlength, encoding, isawaymsg); |
694 | 697 |
695 free(msg); | 698 free(msg); |
696 } | 699 } |
700 | |
701 free(snptr); | |
697 | 702 |
698 return ret; | 703 return ret; |
699 } | 704 } |
700 | 705 |
701 /** | 706 /** |