|
|
@@ -57,6 +57,7 @@
|
|
|
#include "EncryptedStream.h"
|
|
|
|
|
|
char userfile[121] = ""; /* where the user records are stored */
|
|
|
+char autolink_failed[HANDLEN + 1] = "";
|
|
|
interval_t ignore_time = 10; /* how many minutes will ignores last? */
|
|
|
bool dont_restructure = 0; /* set when we botlink() to a hub with +U, only stops bot from restructuring */
|
|
|
|
|
|
@@ -1003,7 +1004,7 @@ struct userrec *next_hub(struct userrec *current, char *lowval, char *highval)
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
-void autolink_cycle_hub(char *start)
|
|
|
+static void autolink_cycle_hub(char *start)
|
|
|
{
|
|
|
char bestval[HANDLEN + 4] = "", curval[HANDLEN + 4] = "", myval[HANDLEN + 4] = "";
|
|
|
tand_t *bot = NULL;
|
|
|
@@ -1083,7 +1084,7 @@ typedef struct hublist_entry {
|
|
|
|
|
|
int botlinkcount = 0;
|
|
|
|
|
|
-void autolink_random_hub(char *avoidbot) {
|
|
|
+static void autolink_random_hub(char *avoidbot) {
|
|
|
/* Pick a random hub, but avoid 'avoidbot' */
|
|
|
int hlc = 0;
|
|
|
struct hublist_entry *hl = NULL, *hl2 = NULL;
|
|
|
@@ -1125,7 +1126,7 @@ void autolink_random_hub(char *avoidbot) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-void autolink_cycle_leaf(char *start)
|
|
|
+static void autolink_cycle_leaf(char *start)
|
|
|
{
|
|
|
struct bot_addr *my_ba = (struct bot_addr *) get_user(&USERENTRY_BOTADDR, conf.bot->u);
|
|
|
char uplink[HANDLEN + 1] = "", avoidbot[HANDLEN + 1] = "", curhub[HANDLEN + 1] = "";
|
|
|
@@ -1195,12 +1196,19 @@ void autolink_cycle_leaf(char *start)
|
|
|
}
|
|
|
|
|
|
|
|
|
-void autolink_cycle(char *start)
|
|
|
+void autolink_cycle()
|
|
|
{
|
|
|
+ char start[HANDLEN + 1] = "";
|
|
|
+
|
|
|
+ if (autolink_failed[0]) {
|
|
|
+ strlcpy(start, autolink_failed, HANDLEN + 1);
|
|
|
+ autolink_failed[0] = 0;
|
|
|
+ }
|
|
|
+
|
|
|
if (conf.bot->hub)
|
|
|
- autolink_cycle_hub(start);
|
|
|
+ autolink_cycle_hub(start[0] ? start : NULL);
|
|
|
else if (conf.bot->localhub)
|
|
|
- autolink_cycle_leaf(start);
|
|
|
+ autolink_cycle_leaf(start[0] ? start : NULL);
|
|
|
else { //Connect to the localhub
|
|
|
if (tands == 0) {
|
|
|
// Make sure not already trying for the localhub
|