changeset 15110:6cc89a43bf8f

[gaim-migrate @ 17896] Lower the away-message fetching timeout from 10 seconds to half a second. The rate limiting stuff will hopefully kick in if needed. Let me know if you have problems. Like rate-related error messages or GUI components not redrawing. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 05 Dec 2006 06:23:43 +0000
parents 699e4c6c9d14
children cde909b9eb4b
files libgaim/protocols/oscar/family_locate.c libgaim/protocols/oscar/flap_connection.c
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/oscar/family_locate.c	Mon Dec 04 21:56:32 2006 +0000
+++ b/libgaim/protocols/oscar/family_locate.c	Tue Dec 05 06:23:43 2006 +0000
@@ -393,7 +393,7 @@
 		 * requesting away messages and info too quickly.
 		 */
 		if (od->getinfotimer == 0)
-			od->getinfotimer = gaim_timeout_add(10000,
+			od->getinfotimer = gaim_timeout_add(500,
 					gaim_reqinfo_timeout_cb, od);
 	}
 
--- a/libgaim/protocols/oscar/flap_connection.c	Mon Dec 04 21:56:32 2006 +0000
+++ b/libgaim/protocols/oscar/flap_connection.c	Tue Dec 05 06:23:43 2006 +0000
@@ -97,11 +97,11 @@
  * were to send a SNAC in this rateclass at the given time.
  */
 static guint32
-rateclass_get_new_current(FlapConnection *conn, struct rateclass *rateclass, struct timeval now)
+rateclass_get_new_current(FlapConnection *conn, struct rateclass *rateclass, struct timeval *now)
 {
 	unsigned long timediff; /* In milliseconds */
 
-	timediff = (now.tv_sec - rateclass->last.tv_sec) * 1000 + (now.tv_usec - rateclass->last.tv_usec) / 1000;
+	timediff = (now->tv_sec - rateclass->last.tv_sec) * 1000 + (now->tv_usec - rateclass->last.tv_usec) / 1000;
 
 	/* This formula is taken from the joscar API docs. Preesh. */
 	return MIN(((rateclass->current * (rateclass->windowsize - 1)) + timediff) / rateclass->windowsize, rateclass->max);
@@ -127,7 +127,7 @@
 		{
 			guint32 new_current;
 
-			new_current = rateclass_get_new_current(conn, rateclass, now);
+			new_current = rateclass_get_new_current(conn, rateclass, &now);
 
 			if (new_current < rateclass->alert)
 				/* Not ready to send this SNAC yet--keep waiting. */
@@ -183,7 +183,7 @@
 		guint32 new_current;
 
 		gettimeofday(&now, NULL);
-		new_current = rateclass_get_new_current(conn, rateclass, now);
+		new_current = rateclass_get_new_current(conn, rateclass, &now);
 
 		if (new_current < rateclass->alert)
 		{