Mercurial > pidgin
comparison src/protocols/oscar/rxhandlers.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 | ad9258716144 |
children | a88ca6da0b38 |
comparison
equal
deleted
inserted
replaced
11252:55356a29cdd1 | 11253:7d31d61e6438 |
---|---|
66 } | 66 } |
67 | 67 |
68 mod->next = (aim_module_t *)sess->modlistv; | 68 mod->next = (aim_module_t *)sess->modlistv; |
69 sess->modlistv = mod; | 69 sess->modlistv = mod; |
70 | 70 |
71 faimdprintf(sess, 1, "registered module %s (family 0x%04x, version = 0x%04x, tool 0x%04x, tool version 0x%04x)\n", mod->name, mod->family, mod->version, mod->toolid, mod->toolversion); | 71 gaim_debug_misc("oscar", "registered module %s (family 0x%04x, version = 0x%04x, tool 0x%04x, tool version 0x%04x)\n", mod->name, mod->family, mod->version, mod->toolid, mod->toolversion); |
72 | 72 |
73 return 0; | 73 return 0; |
74 } | 74 } |
75 | 75 |
76 faim_internal void aim__shutdownmodules(aim_session_t *sess) | 76 faim_internal void aim__shutdownmodules(aim_session_t *sess) |
374 | 374 |
375 family = aimbs_get16(&frame->data); | 375 family = aimbs_get16(&frame->data); |
376 subtype = aimbs_get16(&frame->data); | 376 subtype = aimbs_get16(&frame->data); |
377 | 377 |
378 if ((family < maxf) && (subtype+1 < maxs) && (literals[family][subtype] != NULL)) | 378 if ((family < maxf) && (subtype+1 < maxs) && (literals[family][subtype] != NULL)) |
379 faimdprintf(sess, 0, "bleck: channel %s: null handler for %04x/%04x (%s)\n", channels[frame->hdr.flap.channel], family, subtype, literals[family][subtype+1]); | 379 gaim_debug_misc("oscar", "bleck: channel %s: null handler for %04x/%04x (%s)\n", channels[frame->hdr.flap.channel], family, subtype, literals[family][subtype+1]); |
380 else | 380 else |
381 faimdprintf(sess, 0, "bleck: channel %s: null handler for %04x/%04x (no literal)\n", channels[frame->hdr.flap.channel], family, subtype); | 381 gaim_debug_misc("oscar", "bleck: channel %s: null handler for %04x/%04x (no literal)\n", channels[frame->hdr.flap.channel], family, subtype); |
382 } else { | 382 } else { |
383 | 383 |
384 if (frame->hdr.flap.channel <= maxchannels) | 384 if (frame->hdr.flap.channel <= maxchannels) |
385 faimdprintf(sess, 0, "bleck: channel %s (0x%02x)\n", channels[frame->hdr.flap.channel], frame->hdr.flap.channel); | 385 gaim_debug_misc("oscar", "bleck: channel %s (0x%02x)\n", channels[frame->hdr.flap.channel], frame->hdr.flap.channel); |
386 else | 386 else |
387 faimdprintf(sess, 0, "bleck: unknown channel 0x%02x\n", frame->hdr.flap.channel); | 387 gaim_debug_misc("oscar", "bleck: unknown channel 0x%02x\n", frame->hdr.flap.channel); |
388 | 388 |
389 } | 389 } |
390 | 390 |
391 return 1; | 391 return 1; |
392 } | 392 } |
396 struct aim_rxcblist_s *newcb; | 396 struct aim_rxcblist_s *newcb; |
397 | 397 |
398 if (!conn) | 398 if (!conn) |
399 return -1; | 399 return -1; |
400 | 400 |
401 faimdprintf(sess, 1, "aim_conn_addhandler: adding for %04x/%04x\n", family, type); | 401 gaim_debug_misc("oscar", "aim_conn_addhandler: adding for %04x/%04x\n", family, type); |
402 | 402 |
403 if (!(newcb = (struct aim_rxcblist_s *)calloc(1, sizeof(struct aim_rxcblist_s)))) | 403 if (!(newcb = (struct aim_rxcblist_s *)calloc(1, sizeof(struct aim_rxcblist_s)))) |
404 return -1; | 404 return -1; |
405 | 405 |
406 newcb->family = family; | 406 newcb->family = family; |
446 struct aim_rxcblist_s *cur; | 446 struct aim_rxcblist_s *cur; |
447 | 447 |
448 if (!conn) | 448 if (!conn) |
449 return NULL; | 449 return NULL; |
450 | 450 |
451 faimdprintf(sess, 1, "aim_callhandler: calling for %04x/%04x\n", family, type); | 451 /* gaim_debug_misc("oscar", "aim_callhandler: calling for %04x/%04x\n", family, type); */ |
452 | 452 |
453 for (cur = (struct aim_rxcblist_s *)conn->handlerlist; cur; cur = cur->next) { | 453 for (cur = (struct aim_rxcblist_s *)conn->handlerlist; cur; cur = cur->next) { |
454 if ((cur->family == family) && (cur->type == type)) | 454 if ((cur->family == family) && (cur->type == type)) |
455 return cur->handler; | 455 return cur->handler; |
456 } | 456 } |
457 | 457 |
458 if (type == AIM_CB_SPECIAL_DEFAULT) { | 458 if (type == AIM_CB_SPECIAL_DEFAULT) { |
459 faimdprintf(sess, 1, "aim_callhandler: no default handler for family 0x%04x\n", family); | 459 /* gaim_debug_misc("oscar", "aim_callhandler: no default handler for family 0x%04x\n", family); */ |
460 return NULL; /* prevent infinite recursion */ | 460 return NULL; /* prevent infinite recursion */ |
461 } | 461 } |
462 | 462 |
463 faimdprintf(sess, 1, "aim_callhandler: no handler for 0x%04x/0x%04x\n", family, type); | 463 /* gaim_debug_misc("oscar", "aim_callhandler: no handler for 0x%04x/0x%04x\n", family, type); */ |
464 | 464 |
465 return aim_callhandler(sess, conn, family, AIM_CB_SPECIAL_DEFAULT); | 465 return aim_callhandler(sess, conn, family, AIM_CB_SPECIAL_DEFAULT); |
466 } | 466 } |
467 | 467 |
468 faim_internal void aim_clonehandlers(aim_session_t *sess, aim_conn_t *dest, aim_conn_t *src) | 468 faim_internal void aim_clonehandlers(aim_session_t *sess, aim_conn_t *dest, aim_conn_t *src) |
539 cur->handled = 1; | 539 cur->handled = 1; |
540 continue; | 540 continue; |
541 | 541 |
542 } else if (cur->conn->type == AIM_CONN_TYPE_LISTENER) { | 542 } else if (cur->conn->type == AIM_CONN_TYPE_LISTENER) { |
543 /* not possible */ | 543 /* not possible */ |
544 faimdprintf(sess, 0, "rxdispatch called on LISTENER connection!\n"); | 544 gaim_debug_misc("oscar", "rxdispatch called on LISTENER connection!\n"); |
545 cur->handled = 1; | 545 cur->handled = 1; |
546 continue; | 546 continue; |
547 } | 547 } |
548 } | 548 } |
549 | 549 |
551 consumenonsnac(sess, cur, 0xffff, 0xffff); /* last chance! */ | 551 consumenonsnac(sess, cur, 0xffff, 0xffff); /* last chance! */ |
552 cur->handled = 1; | 552 cur->handled = 1; |
553 } | 553 } |
554 } | 554 } |
555 | 555 |
556 /* | 556 /* |
557 * This doesn't have to be called here. It could easily be done | 557 * This doesn't have to be called here. It could easily be done |
558 * by a separate thread or something. It's an administrative operation, | 558 * by a separate thread or something. It's an administrative operation, |
559 * and can take a while. Though the less you call it the less memory | 559 * and can take a while. Though the less you call it the less memory |
560 * you'll have :) | 560 * you'll have :) |
561 */ | 561 */ |
566 | 566 |
567 faim_internal int aim_parse_unknown(aim_session_t *sess, aim_frame_t *frame, ...) | 567 faim_internal int aim_parse_unknown(aim_session_t *sess, aim_frame_t *frame, ...) |
568 { | 568 { |
569 int i; | 569 int i; |
570 | 570 |
571 faimdprintf(sess, 1, "\nRecieved unknown packet:"); | 571 gaim_debug_misc("oscar", "\nRecieved unknown packet:"); |
572 | 572 |
573 for (i = 0; aim_bstream_empty(&frame->data); i++) { | 573 for (i = 0; aim_bstream_empty(&frame->data); i++) { |
574 if ((i % 8) == 0) | 574 if ((i % 8) == 0) |
575 faimdprintf(sess, 1, "\n\t"); | 575 gaim_debug_misc("oscar", "\n\t"); |
576 | 576 |
577 faimdprintf(sess, 1, "0x%2x ", aimbs_get8(&frame->data)); | 577 gaim_debug_misc("oscar", "0x%2x ", aimbs_get8(&frame->data)); |
578 } | 578 } |
579 | 579 |
580 faimdprintf(sess, 1, "\n\n"); | 580 gaim_debug_misc("oscar", "\n\n"); |
581 | 581 |
582 return 1; | 582 return 1; |
583 } | 583 } |