comparison src/protocols/oscar/service.c @ 11253:7d31d61e6438

[gaim-migrate @ 13422] Get rid of faimdprintf and use gaim_debug functions instead committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sat, 13 Aug 2005 06:43:45 +0000
parents 657aa9a3a7b0
children 677a3862260f
comparison
equal deleted inserted replaced
11252:55356a29cdd1 11253:7d31d61e6438
26 snacid = aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0); 26 snacid = aim_cachesnac(sess, 0x0001, 0x0002, 0x0000, NULL, 0);
27 aim_putsnac(&fr->data, 0x0001, 0x0002, 0x0000, snacid); 27 aim_putsnac(&fr->data, 0x0001, 0x0002, 0x0000, snacid);
28 28
29 /* 29 /*
30 * Send only the tool versions that the server cares about (that it 30 * Send only the tool versions that the server cares about (that it
31 * marked as supporting in the server ready SNAC). 31 * marked as supporting in the server ready SNAC).
32 */ 32 */
33 for (sg = ins->groups; sg; sg = sg->next) { 33 for (sg = ins->groups; sg; sg = sg->next) {
34 aim_module_t *mod; 34 aim_module_t *mod;
35 35
36 if ((mod = aim__findmodulebygroup(sess, sg->group))) { 36 if ((mod = aim__findmodulebygroup(sess, sg->group))) {
37 aimbs_put16(&fr->data, mod->family); 37 aimbs_put16(&fr->data, mod->family);
38 aimbs_put16(&fr->data, mod->version); 38 aimbs_put16(&fr->data, mod->version);
39 aimbs_put16(&fr->data, mod->toolid); 39 aimbs_put16(&fr->data, mod->toolid);
40 aimbs_put16(&fr->data, mod->toolversion); 40 aimbs_put16(&fr->data, mod->toolversion);
41 } else 41 } else
42 faimdprintf(sess, 1, "aim_clientready: server supports group 0x%04x but we don't!\n", sg->group); 42 gaim_debug_misc("oscar", "aim_clientready: server supports group 0x%04x but we don't!\n", sg->group);
43 } 43 }
44 44
45 aim_tx_enqueue(sess, fr); 45 aim_tx_enqueue(sess, fr);
46 46
47 return 0; 47 return 0;
48 } 48 }
49 49
50 /* 50 /*
51 * Subtype 0x0003 - Host Online 51 * Subtype 0x0003 - Host Online
52 * 52 *
53 * See comments in conn.c about how the group associations are supposed 53 * See comments in conn.c about how the group associations are supposed
54 * to work, and how they really work. 54 * to work, and how they really work.
55 * 55 *
56 * This info probably doesn't even need to make it to the client. 56 * This info probably doesn't even need to make it to the client.
57 * 57 *
58 * We don't actually call the client here. This starts off the connection 58 * We don't actually call the client here. This starts off the connection
59 * initialization routine required by all AIM connections. The next time 59 * initialization routine required by all AIM connections. The next time
60 * the client is called is the CONNINITDONE callback, which should be 60 * the client is called is the CONNINITDONE callback, which should be
61 * shortly after the rate information is acknowledged. 61 * shortly after the rate information is acknowledged.
62 * 62 *
63 */ 63 */
64 static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) 64 static int hostonline(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
65 { 65 {
66 fu16_t *families; 66 fu16_t *families;
67 int famcount; 67 int famcount;
333 * the new version hardcoded here. 333 * the new version hardcoded here.
334 */ 334 */
335 if (mod->version >= 3) 335 if (mod->version >= 3)
336 aimbs_getrawbuf(bs, rc.unknown, sizeof(rc.unknown)); 336 aimbs_getrawbuf(bs, rc.unknown, sizeof(rc.unknown));
337 337
338 faimdprintf(sess, 1, "--- Adding rate class %d to connection type %d: window size = %ld, clear = %ld, alert = %ld, limit = %ld, disconnect = %ld, current = %ld, max = %ld\n", rx->conn->type, rc.classid, rc.windowsize, rc.clear, rc.alert, rc.limit, rc.disconnect, rc.current, rc.max); 338 gaim_debug_misc("oscar", "--- Adding rate class %d to connection type %d: window size = %ld, clear = %ld, alert = %ld, limit = %ld, disconnect = %ld, current = %ld, max = %ld\n", rx->conn->type, rc.classid, rc.windowsize, rc.clear, rc.alert, rc.limit, rc.disconnect, rc.current, rc.max);
339 339
340 rc_addclass(&ins->rates, &rc); 340 rc_addclass(&ins->rates, &rc);
341 } 341 }
342 342
343 /* 343 /*
626 for (i = 0; i < groupcount; i++) { 626 for (i = 0; i < groupcount; i++) {
627 fu16_t group; 627 fu16_t group;
628 628
629 group = aimbs_get16(bs); 629 group = aimbs_get16(bs);
630 630
631 faimdprintf(sess, 0, "bifurcated migration unsupported -- group 0x%04x\n", group); 631 gaim_debug_misc("oscar", "bifurcated migration unsupported -- group 0x%04x\n", group);
632 } 632 }
633 633
634 tl = aim_tlvlist_read(bs); 634 tl = aim_tlvlist_read(bs);
635 635
636 if (aim_tlv_gettlv(tl, 0x0005, 1)) 636 if (aim_tlv_gettlv(tl, 0x0005, 1))
752 752
753 if ((mod = aim__findmodulebygroup(sess, sg->group))) { 753 if ((mod = aim__findmodulebygroup(sess, sg->group))) {
754 aimbs_put16(&fr->data, mod->family); 754 aimbs_put16(&fr->data, mod->family);
755 aimbs_put16(&fr->data, mod->version); 755 aimbs_put16(&fr->data, mod->version);
756 } else 756 } else
757 faimdprintf(sess, 1, "aim_setversions: server supports group 0x%04x but we don't!\n", sg->group); 757 gaim_debug_misc("oscar", "aim_setversions: server supports group 0x%04x but we don't!\n", sg->group);
758 } 758 }
759 759
760 aim_tx_enqueue(sess, fr); 760 aim_tx_enqueue(sess, fr);
761 761
762 return 0; 762 return 0;
932 len = aimbs_get32(bs); 932 len = aimbs_get32(bs);
933 list = aim_tlvlist_read(bs); 933 list = aim_tlvlist_read(bs);
934 934
935 modname = aim_tlv_getstr(list, 0x0001, 1); 935 modname = aim_tlv_getstr(list, 0x0001, 1);
936 936
937 faimdprintf(sess, 1, "data at 0x%08lx (%d bytes) of requested %s\n", offset, len, modname ? modname : "aim.exe"); 937 gaim_debug_info("oscar", "Got memory request for data at 0x%08lx (%d bytes) of requested %s\n", offset, len, modname ? modname : "aim.exe");
938 938
939 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) 939 if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype)))
940 ret = userfunc(sess, rx, offset, len, modname); 940 ret = userfunc(sess, rx, offset, len, modname);
941 941
942 free(modname); 942 free(modname);
943 aim_tlvlist_free(&list); 943 aim_tlvlist_free(&list);
944 944
945 return ret; 945 return ret;
946 } 946 }
947
948 #if 0
949 static void dumpbox(aim_session_t *sess, unsigned char *buf, int len)
950 {
951 int i;
952
953 if (!sess || !buf || !len)
954 return;
955
956 faimdprintf(sess, 1, "\nDump of %d bytes at %p:", len, buf);
957
958 for (i = 0; i < len; i++) {
959 if ((i % 8) == 0)
960 faimdprintf(sess, 1, "\n\t");
961
962 faimdprintf(sess, 1, "0x%2x ", buf[i]);
963 }
964
965 faimdprintf(sess, 1, "\n\n");
966
967 return;
968 }
969 #endif
970 947
971 /* Subtype 0x0020 - Client verification reply */ 948 /* Subtype 0x0020 - Client verification reply */
972 faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag) 949 faim_export int aim_sendmemblock(aim_session_t *sess, aim_conn_t *conn, fu32_t offset, fu32_t len, const fu8_t *buf, fu8_t flag)
973 { 950 {
974 aim_frame_t *fr; 951 aim_frame_t *fr;
1044 aimbs_put32(&fr->data, 0x8f00b204); 1021 aimbs_put32(&fr->data, 0x8f00b204);
1045 aimbs_put32(&fr->data, 0xe9800998); 1022 aimbs_put32(&fr->data, 0xe9800998);
1046 aimbs_put32(&fr->data, 0xecf8427e); 1023 aimbs_put32(&fr->data, 0xecf8427e);
1047 1024
1048 } else 1025 } else
1049 faimdprintf(sess, 0, "sendmemblock: WARNING: unknown hash request\n"); 1026 gaim_debug_warning("oscar", "sendmemblock: unknown hash request\n");
1050 1027
1051 } 1028 }
1052 1029
1053 aim_tx_enqueue(sess, fr); 1030 aim_tx_enqueue(sess, fr);
1054 1031
1056 } 1033 }
1057 1034
1058 /* 1035 /*
1059 * Subtype 0x0021 - Receive our extended status 1036 * Subtype 0x0021 - Receive our extended status
1060 * 1037 *
1061 * This is used for iChat's "available" messages, and maybe ICQ extended 1038 * This is used for iChat's "available" messages, and maybe ICQ extended
1062 * status messages? It's also used to tell the client whether or not it 1039 * status messages? It's also used to tell the client whether or not it
1063 * needs to upload an SSI buddy icon... who engineers this stuff, anyway? 1040 * needs to upload an SSI buddy icon... who engineers this stuff, anyway?
1064 */ 1041 */
1065 static int aim_parse_extstatus(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) 1042 static int aim_parse_extstatus(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs)
1066 { 1043 {
1067 int ret = 0; 1044 int ret = 0;