# HG changeset patch # User Mark Doliner # Date 1265154273 0 # Node ID 89bece95a52232f3d0ebefc897bea45df4170e1d # Parent 6b0c4667c4fb9a27b38ec9b31b55769b500b81d0 We were using this formula from before the documentation was public, and for some reason I think it's a good idea for this comment to not indicate that we got the formula from the documentation diff -r 6b0c4667c4fb -r 89bece95a522 libpurple/protocols/oscar/flap_connection.c --- a/libpurple/protocols/oscar/flap_connection.c Tue Feb 02 23:24:20 2010 +0000 +++ b/libpurple/protocols/oscar/flap_connection.c Tue Feb 02 23:44:33 2010 +0000 @@ -133,10 +133,10 @@ unsigned long timediff; /* In milliseconds */ guint32 current; + /* This formula is documented at http://dev.aol.com/aim/oscar/#RATELIMIT */ timediff = (now->tv_sec - rateclass->last.tv_sec) * 1000 + (now->tv_usec - rateclass->last.tv_usec) / 1000; current = ((rateclass->current * (rateclass->windowsize - 1)) + timediff) / rateclass->windowsize; - /* This formula is taken from http://dev.aol.com/aim/oscar/#RATELIMIT */ return MIN(current, rateclass->max); }