summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-05-07 14:11:21 -0400
committerAdam <Adam@anope.org>2010-06-18 20:58:55 -0400
commit9439cac6b126254bc488c2375b9e7ff5fd4fce74 (patch)
treed0f6bba4de5b0a4131a6b91eb711b6bf1960def8 /src/main.c
parenta93be9ff1c417d73015fd53a9ee778ea2a642328 (diff)
Added m_ssl.cpp which allows Anope to use SSL when connecting to its uplink
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 234a2e023..4c91fcde2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -389,10 +389,16 @@ std::string GetFullProgDir(char *argv0)
static bool Connect()
{
+ EventReturn MOD_RESULT;
+ FOREACH_RESULT(I_OnPreServerConnect, OnPreServerConnect());
+ if (MOD_RESULT != EVENT_CONTINUE)
+ {
+ return (MOD_RESULT == EVENT_ALLOW ? true : false);
+ }
+
/* Connect to the remote server */
- std::list<Uplink *>::iterator curr_uplink = Config.Uplinks.begin(), end_uplink = Config.Uplinks.end();
int servernum = 1;
- for (; curr_uplink != end_uplink; ++curr_uplink, ++servernum)
+ for (std::list<Uplink *>::iterator curr_uplink = Config.Uplinks.begin(); curr_uplink != Config.Uplinks.end(); ++curr_uplink, ++servernum)
{
uplink_server = *curr_uplink;
@@ -472,8 +478,6 @@ int main(int ac, char **av, char **envp)
if ((i = init_secondary(ac, av)) != 0)
return i;
- FOREACH_MOD(I_OnPreServerConnect, OnPreServerConnect());
-
/* If the first connect fails give up, don't sit endlessly trying to reconnect */
if (!Connect())
fatal_perror("Can't connect to any servers");