diff libpurple/protocols/oscar/flap_connection.c @ 22700:979a81468e19

All SNACs on FLAP channel 2 except in the auth family are now sent through flap_connection_send_snac() instead of flap_connection_send(). This allows them to be tallied into the rate limiting calculations and to be throttled as necessary to prevent rate limiting violations. This does fix the instantaneous disconnection seen with the addition of ICQ Status Notes support for people with many ICQ contacts with status notes on their buddy list. Unfortunately, we still request the ICQ Status Note many times per contact, so such people now may be rate limited for a significant period of time as they connect.
author Evan Schoenberg <evan.s@dreskin.net>
date Thu, 24 Apr 2008 11:10:03 +0000
parents 3225c99785b8
children da3de0190be2
line wrap: on
line diff
--- a/libpurple/protocols/oscar/flap_connection.c	Thu Apr 24 02:16:30 2008 +0000
+++ b/libpurple/protocols/oscar/flap_connection.c	Thu Apr 24 11:10:03 2008 +0000
@@ -115,6 +115,7 @@
 	conn = data;
 	gettimeofday(&now, NULL);
 
+	purple_debug_info("oscar", "Attempting to send %i queued SNACs for %p\n", g_queue_get_length(conn->queued_snacs), conn);
 	while (!g_queue_is_empty(conn->queued_snacs))
 	{
 		QueuedSnac *queued_snac;
@@ -189,6 +190,8 @@
 		/* (Add 100ms padding to account for inaccuracies in the calculation) */
 		if (new_current < rateclass->alert + 100)
 		{
+			purple_debug_info("oscar", "Current rate for conn %p would be %u, but we alert at %u; enqueueing\n", conn, new_current, (rateclass->alert + 100));
+
 			enqueue = TRUE;
 		}
 		else
@@ -197,6 +200,8 @@
 			rateclass->last.tv_sec = now.tv_sec;
 			rateclass->last.tv_usec = now.tv_usec;
 		}
+	} else {
+		purple_debug_warning("oscar", "No rate class found for family %u subtype %u\n", family, subtype);
 	}
 
 	if (enqueue)