summaryrefslogtreecommitdiff
path: root/src/inspircd.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-11 17:22:52 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2004-04-11 17:22:52 +0000
commit292bab4c818af5a189b6ff393d4c9e522b5fdd6e (patch)
tree32f722c54de1e4bc90d9941d026021255cd7a1ed /src/inspircd.cpp
parent93f59f53c2dc85ec09926d14123eaf0e94c70d42 (diff)
race condition fixes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@537 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r--src/inspircd.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 2bdb46a0b..1adaac580 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -6570,6 +6570,7 @@ void handle_link_packet(long theirkey, char* udp_msg, char* udp_host, int udp_po
strcpy(servers[j]->description,serverdesc);
servers[j]->internal_port = udp_port;
// create a server record for this server
+ WriteOpers("Server %s authenticated, exchanging server keys...",servername);
snprintf(response,10240,"O %d",MyKey);
serv->SendPacket(response,udp_host,udp_port,0);
return;
@@ -6604,10 +6605,7 @@ void handle_link_packet(long theirkey, char* udp_msg, char* udp_host, int udp_po
if (!strcasecmp(servers[i]->internal_addr,udp_host)) {
servers[i]->key = atoi(params);
log(DEBUG,"Key for this server is now %d",servers[i]->key);
- //if (servers[i]->initiator)
- //{
- DoSync(serv,udp_host,udp_port,MyKey);
- //}
+ servers[i]->sync_soon = true;
return;
}
}
@@ -6925,6 +6923,17 @@ int InspIRCd(void)
}
fd_reap.clear();
reap_counter=0;
+ for (int j = 0; j < 255; j++)
+ {
+ if (servers[j])
+ {
+ if (servers[j]->sync_soon)
+ {
+ servers[j]->sync_soon = false;
+ DoSync(servers[j],servers[j]->internal_addr,servers[j]->internal_port,MyKey);
+ }
+ }
+ }
}