comparison libpurple/protocols/oscar/flap_connection.c @ 17445:f80f7e1047be

Cleanup and simplification of some tlvlist stuff in the oscar protocol. No functionality change.
author Mark Doliner <mark@kingant.net>
date Tue, 29 May 2007 09:51:51 +0000
parents 1927f4ead3ca
children 648551e3243a
comparison
equal deleted inserted replaced
17444:b31f53796f3b 17445:f80f7e1047be
59 */ 59 */
60 void 60 void
61 flap_connection_send_version_with_cookie(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy) 61 flap_connection_send_version_with_cookie(OscarData *od, FlapConnection *conn, guint16 length, const guint8 *chipsahoy)
62 { 62 {
63 FlapFrame *frame; 63 FlapFrame *frame;
64 aim_tlvlist_t *tl = NULL; 64 GSList *tlvlist = NULL;
65 65
66 frame = flap_frame_new(od, 0x01, 4 + 2 + 2 + length); 66 frame = flap_frame_new(od, 0x01, 4 + 2 + 2 + length);
67 byte_stream_put32(&frame->data, 0x00000001); 67 byte_stream_put32(&frame->data, 0x00000001);
68 aim_tlvlist_add_raw(&tl, 0x0006, length, chipsahoy); 68 aim_tlvlist_add_raw(&tlvlist, 0x0006, length, chipsahoy);
69 aim_tlvlist_write(&frame->data, &tl); 69 aim_tlvlist_write(&frame->data, &tlvlist);
70 aim_tlvlist_free(&tl); 70 aim_tlvlist_free(tlvlist);
71 71
72 flap_connection_send(conn, frame); 72 flap_connection_send(conn, frame);
73 } 73 }
74 74
75 static struct rateclass * 75 static struct rateclass *
691 } 691 }
692 692
693 static void 693 static void
694 parse_flap_ch4(OscarData *od, FlapConnection *conn, FlapFrame *frame) 694 parse_flap_ch4(OscarData *od, FlapConnection *conn, FlapFrame *frame)
695 { 695 {
696 aim_tlvlist_t *tlvlist; 696 GSList *tlvlist;
697 char *msg = NULL; 697 char *msg = NULL;
698 guint16 code = 0; 698 guint16 code = 0;
699 aim_rxcallback_t userfunc; 699 aim_rxcallback_t userfunc;
700 700
701 if (byte_stream_empty(&frame->data) == 0) { 701 if (byte_stream_empty(&frame->data) == 0) {
719 msg = aim_tlv_getstr(tlvlist, 0x000b, 1); 719 msg = aim_tlv_getstr(tlvlist, 0x000b, 1);
720 720
721 if ((userfunc = aim_callhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR))) 721 if ((userfunc = aim_callhandler(od, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR)))
722 userfunc(od, conn, frame, code, msg); 722 userfunc(od, conn, frame, code, msg);
723 723
724 aim_tlvlist_free(&tlvlist); 724 aim_tlvlist_free(tlvlist);
725 725
726 g_free(msg); 726 g_free(msg);
727 } 727 }
728 728
729 /** 729 /**