Mercurial > pidgin.yaz
comparison plugins/autorecon.c @ 4590:3b8e6c2b4a50
[gaim-migrate @ 4874]
changing MAX to MIN makes MAXTIME truely the max delay time. i also increased the max delay to 34 min instead of 17 min, since that's what i remember it being.
Many thanks to Adam Feakin for pointing out that this code was behaving badly.
committer: Tailor Script <tailor@pidgin.im>
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 20 Feb 2003 00:52:19 +0000 |
parents | 2427d847e39c |
children | fefad67de2c7 |
comparison
equal
deleted
inserted
replaced
4589:eddb870a3c4d | 4590:3b8e6c2b4a50 |
---|---|
12 #endif | 12 #endif |
13 | 13 |
14 G_MODULE_IMPORT GSList *gaim_accounts; | 14 G_MODULE_IMPORT GSList *gaim_accounts; |
15 | 15 |
16 #define INITIAL 8000 | 16 #define INITIAL 8000 |
17 #define MAXTIME 1024000 | 17 #define MAXTIME 2048000 |
18 | 18 |
19 static GHashTable *hash = NULL; | 19 static GHashTable *hash = NULL; |
20 | 20 |
21 static guint tim = 0; | 21 static guint tim = 0; |
22 | 22 |
38 int del; | 38 int del; |
39 del = (int)g_hash_table_lookup(hash, gc->account); | 39 del = (int)g_hash_table_lookup(hash, gc->account); |
40 if (!del) | 40 if (!del) |
41 del = INITIAL; | 41 del = INITIAL; |
42 else | 42 else |
43 del = MAX(2 * del, MAXTIME); | 43 del = MIN(2 * del, MAXTIME); |
44 tim = g_timeout_add(del, do_signon, gc->account); | 44 tim = g_timeout_add(del, do_signon, gc->account); |
45 g_hash_table_insert(hash, gc->account, (gpointer)del); | 45 g_hash_table_insert(hash, gc->account, (gpointer)del); |
46 } else { | 46 } else { |
47 g_hash_table_remove(hash, gc->account); | 47 g_hash_table_remove(hash, gc->account); |
48 } | 48 } |