comparison src/protocols/oscar/rxhandlers.c @ 6905:90cfd31c506f

[gaim-migrate @ 7452] Minor changes to some of the connection establishment stuff in oscar.c, nothing externally visible. Move along, move along. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 21 Sep 2003 21:08:51 +0000
parents 04dc7fe68889
children 6d3d8f11e765
comparison
equal deleted inserted replaced
6904:7c3a11c69be9 6905:90cfd31c506f
389 } 389 }
390 390
391 return 1; 391 return 1;
392 } 392 }
393 393
394 /*
395 * Some SNACs we do not allow to be hooked, for good reason.
396 */
397 static int checkdisallowed(fu16_t group, fu16_t type)
398 {
399 static const struct {
400 fu16_t group;
401 fu16_t type;
402 } dontuse[] = {
403 {0x0001, 0x0002},
404 {0x0001, 0x0003},
405 {0x0001, 0x0006},
406 {0x0001, 0x0007},
407 {0x0001, 0x0008},
408 {0x0001, 0x0017},
409 {0x0001, 0x0018},
410 {0x0000, 0x0000}
411 };
412 int i;
413
414 for (i = 0; dontuse[i].group != 0x0000; i++) {
415 if ((dontuse[i].group == group) && (dontuse[i].type == type))
416 return 1;
417 }
418
419 return 0;
420 }
421
422 faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t type, aim_rxcallback_t newhandler, fu16_t flags) 394 faim_export int aim_conn_addhandler(aim_session_t *sess, aim_conn_t *conn, fu16_t family, fu16_t type, aim_rxcallback_t newhandler, fu16_t flags)
423 { 395 {
424 struct aim_rxcblist_s *newcb; 396 struct aim_rxcblist_s *newcb;
425 397
426 if (!conn) 398 if (!conn)
427 return -1; 399 return -1;
428 400
429 faimdprintf(sess, 1, "aim_conn_addhandler: adding for %04x/%04x\n", family, type); 401 faimdprintf(sess, 1, "aim_conn_addhandler: adding for %04x/%04x\n", family, type);
430
431 if (checkdisallowed(family, type)) {
432 faimdprintf(sess, 0, "aim_conn_addhandler: client tried to hook %x/%x -- BUG!!!\n", family, type);
433 return -1;
434 }
435 402
436 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))))
437 return -1; 404 return -1;
438 405
439 newcb->family = family; 406 newcb->family = family;