diff options
author | Adam <Adam@drink-coca-cola.info> | 2010-05-07 21:04:18 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-06-18 20:58:55 -0400 |
commit | af805e5b45f75dec7f4ce16ffc322c8880f9859c (patch) | |
tree | ccc5fb87394b0a80dd780d98d2af2f679c0eff68 /src/main.c | |
parent | b775c84402c309ccf4bced359ee714fbedb4dd6e (diff) |
Allow enabling ssl on a per-uplink basis
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c index 4c91fcde2..68423e4ec 100644 --- a/src/main.c +++ b/src/main.c @@ -389,19 +389,21 @@ 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 */ int servernum = 1; for (std::list<Uplink *>::iterator curr_uplink = Config.Uplinks.begin(); curr_uplink != Config.Uplinks.end(); ++curr_uplink, ++servernum) { uplink_server = *curr_uplink; + EventReturn MOD_RESULT; + FOREACH_RESULT(I_OnPreServerConnect, OnPreServerConnect(*curr_uplink, servernum)); + if (MOD_RESULT != EVENT_CONTINUE) + { + if (MOD_RESULT == EVENT_STOP) + break; + return true; + } + try { new UplinkSocket(uplink_server->host, uplink_server->port, Config.LocalHost ? Config.LocalHost : "", uplink_server->ipv6); @@ -416,6 +418,8 @@ static bool Connect() return true; } + uplink_server = NULL; + return false; } |