Revision: 16565
Author: seanegan
Date: 2006-07-24 16:57:11 -0700 (Mon, 24 Jul 2006)
ViewCVS: http://svn.sourceforge.net/gaim/?rev=16565&view=rev
Log Message:
-----------
Randomize initial reconnect delay as not to DoS servers
Modified Paths:
--------------
trunk/src/gtkconn.c
Modified: trunk/src/gtkconn.c
===================================================================
--- trunk/src/gtkconn.c 2006-07-24 23:19:55 UTC (rev 16564)
+++ trunk/src/gtkconn.c 2006-07-24 23:57:11 UTC (rev 16565)
@@ -37,7 +37,9 @@
#include "gtkutils.h"
#include "util.h"
-#define INITIAL_RECON_DELAY 8000
+#define INITIAL_RECON_DELAY_MIN 8000
+#define INITIAL_RECON_DELAY_MAX 60000
+
#define MAX_RECON_DELAY 600000
typedef struct {
@@ -155,7 +157,7 @@
if (info == NULL) {
info = g_new0(GaimAutoRecon, 1);
g_hash_table_insert(hash, account, info);
- info->delay = INITIAL_RECON_DELAY;
+ info->delay = g_random_int_range(INITIAL_RECON_DELAY_MIN, INITIAL_RECON_DELAY_MAX);
} else {
info->delay = MIN(2 * info->delay, MAX_RECON_DELAY);
if (info->timeout != 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|