Mercurial > pidgin.yaz
comparison libfaim/aim_rxhandlers.c @ 715:58106806ac2b
[gaim-migrate @ 725]
yay
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 18 Aug 2000 00:21:53 +0000 |
parents | 6e318907bcce |
children | 58a6e6e26695 |
comparison
equal
deleted
inserted
replaced
714:d7557252bfb1 | 715:58106806ac2b |
---|---|
637 } | 637 } |
638 | 638 |
639 int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command) | 639 int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command) |
640 { | 640 { |
641 rxcallback_t userfunc = NULL; | 641 rxcallback_t userfunc = NULL; |
642 int i = 10; /* skip SNAC */ | |
643 int ret = 1; | 642 int ret = 1; |
644 unsigned long newrate; | 643 unsigned long newrate; |
645 | 644 |
646 if (command->commandlen != 0x2f) { | 645 if (command->commandlen != 0x2f) { |
647 printf("faim: unknown rate change length 0x%04x\n", command->commandlen); | 646 printf("faim: unknown rate change length 0x%04x\n", command->commandlen); |
671 id = aimutil_get16(command->data+10); | 670 id = aimutil_get16(command->data+10); |
672 | 671 |
673 /* | 672 /* |
674 * TLVs follow | 673 * TLVs follow |
675 */ | 674 */ |
676 tlvlist = aim_readtlvchain(command->data+12, command->commandlen-12); | 675 if (!(tlvlist = aim_readtlvchain(command->data+12, command->commandlen-12))) |
677 | 676 return ret; |
678 msg = aim_gettlv_str(tlvlist, 0x000b, 1); | 677 |
678 if (!(msg = aim_gettlv_str(tlvlist, 0x000b, 1))) { | |
679 aim_freetlvchain(&tlvlist); | |
680 return ret; | |
681 } | |
679 | 682 |
680 userfunc = aim_callhandler(command->conn, 0x0001, 0x0013); | 683 userfunc = aim_callhandler(command->conn, 0x0001, 0x0013); |
681 if (userfunc) | 684 if (userfunc) |
682 ret = userfunc(sess, command, id, msg); | 685 ret = userfunc(sess, command, id, msg); |
683 | 686 |
684 aim_freetlvchain(&tlvlist); | 687 aim_freetlvchain(&tlvlist); |
685 | 688 free(msg); |
686 return ret; | 689 |
687 | 690 return ret; |
688 } | 691 } |
689 | 692 |
690 int aim_handleredirect_middle(struct aim_session_t *sess, | 693 int aim_handleredirect_middle(struct aim_session_t *sess, |
691 struct command_rx_struct *command, ...) | 694 struct command_rx_struct *command, ...) |
692 { | 695 { |
713 serviceid = aimutil_get16(tmptlv->value); | 716 serviceid = aimutil_get16(tmptlv->value); |
714 | 717 |
715 if (!(ip = aim_gettlv_str(tlvlist, 0x0005, 1))) | 718 if (!(ip = aim_gettlv_str(tlvlist, 0x0005, 1))) |
716 { | 719 { |
717 printf("libfaim: major bug: no IP in tlvchain from redirect (service 0x%02x)\n", serviceid); | 720 printf("libfaim: major bug: no IP in tlvchain from redirect (service 0x%02x)\n", serviceid); |
721 free(ip); | |
718 aim_freetlvchain(&tlvlist); | 722 aim_freetlvchain(&tlvlist); |
719 return ret; | 723 return ret; |
720 } | 724 } |
721 | 725 |
722 if (!(tmptlv = aim_gettlv(tlvlist, 0x0006, 1))) | 726 if (!(tmptlv = aim_gettlv(tlvlist, 0x0006, 1))) |
723 { | 727 { |
724 printf("libfaim: major bug: no cookie in tlvchain from redirect (service 0x%02x)\n", serviceid); | 728 printf("libfaim: major bug: no cookie in tlvchain from redirect (service 0x%02x)\n", serviceid); |
729 free(ip); | |
725 aim_freetlvchain(&tlvlist); | 730 aim_freetlvchain(&tlvlist); |
726 return ret; | 731 return ret; |
727 } | 732 } |
728 memcpy(cookie, tmptlv->value, AIM_COOKIELEN); | 733 memcpy(cookie, tmptlv->value, AIM_COOKIELEN); |
729 | 734 |
744 userfunc = aim_callhandler(command->conn, 0x0001, 0x0005); | 749 userfunc = aim_callhandler(command->conn, 0x0001, 0x0005); |
745 if (userfunc) | 750 if (userfunc) |
746 ret = userfunc(sess, command, serviceid, ip, cookie); | 751 ret = userfunc(sess, command, serviceid, ip, cookie); |
747 } | 752 } |
748 | 753 |
749 /* | 754 free(ip); |
750 * XXX: Is there a leak here? Where does IP get freed? | |
751 */ | |
752 aim_freetlvchain(&tlvlist); | 755 aim_freetlvchain(&tlvlist); |
753 | 756 |
754 return ret; | 757 return ret; |
755 } | 758 } |
756 | 759 |