summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-24 04:05:14 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2005-05-24 04:05:14 +0000
commit88a4177e285d65affeb2c2b97e308449a2c0cd4c (patch)
tree42361db8c02d39f2d9d495da590a28fd00c4e03a /src/inspircd.cpp
parent66f0cd6469d2643858c2fcd14726d362696bd68d (diff)
Nonblocking connect() for outbound server links (why was this blocking anyway)
Changed /map to show authenticating servers with a * similar to hybrid git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@1485 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 712e26f5e..577741377 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -124,6 +124,7 @@ typedef nspace::hash_map<std::string, chanrec*, nspace::hash<string>, irc::StrHa
typedef nspace::hash_map<in_addr,string*, nspace::hash<in_addr>, irc::InAddr_HashComp> address_cache;
typedef nspace::hash_map<std::string, WhoWasUser*, nspace::hash<string>, irc::StrHashComp> whowas_hash;
typedef std::deque<command_t> command_table;
+typedef std::map<std::string,time_t> autoconnects;
// This table references users by file descriptor.
// its an array to make it VERY fast, as all lookups are referenced
@@ -140,6 +141,7 @@ user_hash clientlist;
chan_hash chanlist;
whowas_hash whowas;
command_table cmdlist;
+autoconnects autoconns;
file_cache MOTD;
file_cache RULES;
address_cache IP;
@@ -398,6 +400,19 @@ void ReadConfig(bool bail, userrec* user)
read_xline_defaults();
log(DEFAULT,"Applying K lines, Q lines and Z lines...");
apply_lines();
+
+ for (int i = 0; i < ConfValueEnum("link",&config_f); i++)
+ {
+ char Link_ServerName[MAXBUF],Link_AConn[MAXBUF];
+ ConfValue("link","name",i,Link_ServerName,&config_f);
+ ConfValue("link","autoconnect",i,Link_AConn,&config_f);
+ if (strcmp(Link_AConn,""))
+ {
+ autoconns[std::string(Link_ServerName)] = atoi(Link_AConn) + time(NULL);
+ }
+ }
+
+
log(DEFAULT,"Done reading configuration file, InspIRCd is now starting.");
if (!bail)
{