]> andersk Git - libfaim.git/blobdiff - aim_rxhandlers.c
- Thu Feb 8 20:12:39 UTC 2001
[libfaim.git] / aim_rxhandlers.c
index 16b77443df251edc771dcc40b37549c58390b1aa..8e5551429236fe7159b3627ee025983b705e1816 100644 (file)
@@ -7,6 +7,7 @@
  *
  */
 
+#define FAIM_INTERNAL
 #include <faim/aim.h>
 
 /*
@@ -515,10 +516,10 @@ faim_export int aim_rxdispatch(struct aim_session_t *sess)
        case 0x000a:  /* Family: User lookup */
          switch (subtype) {
          case 0x0001:
-           workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000a, 0x0001, workingPtr);
+           workingPtr->handled = aim_parse_searcherror(sess, workingPtr);
            break;
          case 0x0003:
-           workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, 0x000a, 0x0003, workingPtr);
+           workingPtr->handled = aim_parse_searchreply(sess, workingPtr);
            break;
          default:
            workingPtr->handled = aim_callhandler_noparam(sess, workingPtr->conn, AIM_CB_FAM_LOK, AIM_CB_LOK_DEFAULT, workingPtr);
@@ -659,13 +660,62 @@ faim_internal int aim_parse_msgack_middle(struct aim_session_t *sess, struct com
   return ret;
 }
 
+/*
+ * The Rate Limiting System, An Abridged Guide to Nonsense.
+ *
+ * OSCAR defines several 'rate classes'.  Each class has seperate
+ * rate limiting properties (limit level, alert level, disconnect
+ * level, etc), and a set of SNAC family/type pairs associated with
+ * it.  The rate classes, their limiting properties, and the definitions
+ * of which SNACs are belong to which class, are defined in the
+ * Rate Response packet at login to each host.  
+ *
+ * Logically, all rate offenses within one class count against further
+ * offenses for other SNACs in the same class (ie, sending messages
+ * too fast will limit the number of user info requests you can send,
+ * since those two SNACs are in the same rate class).
+ *
+ * Since the rate classes are defined dynamically at login, the values
+ * below may change. But they seem to be fairly constant.
+ *
+ * Currently, BOS defines five rate classes, with the commonly used
+ * members as follows...
+ *
+ *  Rate class 0x0001:
+ *     - Everything thats not in any of the other classes
+ *
+ *  Rate class 0x0002:
+ *     - Buddy list add/remove
+ *     - Permit list add/remove
+ *     - Deny list add/remove
+ *
+ *  Rate class 0x0003:
+ *     - User information requests
+ *     - Outgoing ICBMs
+ *
+ *  Rate class 0x0004:
+ *     - A few unknowns: 2/9, 2/b, and f/2
+ *
+ *  Rate class 0x0005:
+ *     - Chat room create
+ *     - Outgoing chat ICBMs
+ *
+ * The only other thing of note is that class 5 (chat) has slightly looser
+ * limiting properties than class 3 (normal messages).  But thats just a 
+ * small bit of trivia for you.
+ *
+ * The last thing that needs to be learned about the rate limiting
+ * system is how the actual numbers relate to the passing of time.  This
+ * seems to be a big mystery.
+ * 
+ */
 faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct command_rx_struct *command)
 {
   rxcallback_t userfunc = NULL;
   int ret = 1;
   int i;
   int code;
-  unsigned long parmid, windowsize, clear, alert, limit, disconnect;
+  unsigned long rateclass, windowsize, clear, alert, limit, disconnect;
   unsigned long currentavg, maxavg;
 
   i = 10;
@@ -673,7 +723,7 @@ faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct
   code = aimutil_get16(command->data+i);
   i += 2;
 
-  parmid = aimutil_get16(command->data+i);
+  rateclass = aimutil_get16(command->data+i);
   i += 2;
 
   windowsize = aimutil_get32(command->data+i);
@@ -692,7 +742,7 @@ faim_internal int aim_parse_ratechange_middle(struct aim_session_t *sess, struct
   i += 4;
 
   if ((userfunc = aim_callhandler(command->conn, 0x0001, 0x000a)))
-    ret =  userfunc(sess, command, code, parmid, windowsize, clear, alert, limit, disconnect, currentavg, maxavg);
+    ret =  userfunc(sess, command, code, rateclass, windowsize, clear, alert, limit, disconnect, currentavg, maxavg);
 
   return ret;
 }
This page took 0.039099 seconds and 4 git commands to generate.