1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-10 05:03:12 +02:00

Protection against linking race conditions is back again (IOTW: allow very rapid re-linking), but only if your network is fully 3.4.x (actually: current git unreal34 or later)

Re-implemented PROTOCTL SERVERS= which nenolod ripped out (#4355).
Add 2nd argument to PROTOCTL EAUTH=servername,unrealprotocol
Change UnrealProtocol from 2350 to 2351
This commit is contained in:
Bram Matthys
2015-07-10 21:57:13 +02:00
parent 5e23fadefb
commit 6c0ebb5bd3
7 changed files with 153 additions and 63 deletions
+16 -5
View File
@@ -98,15 +98,26 @@ int m_server_synch(aClient *cptr, ConfigItem_link *conf);
*/
void _send_protoctl_servers(aClient *sptr, int response)
{
Link *lp;
char buf[512];
char buf[512];
aClient *acptr;
if (!NEW_LINKING_PROTOCOL)
return;
// TODO: reintroduce SERVERS=...
ircsnprintf(buf, sizeof(buf), "PROTOCTL EAUTH=%s",
me.name);
ircsnprintf(buf, sizeof(buf), "PROTOCTL EAUTH=%s,%d SERVERS=%s",
me.name, UnrealProtocol, response ? "*" : "");
list_for_each_entry(acptr, &global_server_list, client_node)
{
if (*acptr->id)
snprintf(buf+strlen(buf), sizeof(buf)-strlen(buf), "%s,", acptr->id);
if (strlen(buf) > sizeof(buf)-12)
break; /* prevent overflow/cutoff if you have a network with more than 90 servers or something. */
}
/* Remove final comma (if any) */
if (buf[strlen(buf)-1] == ',')
buf[strlen(buf)-1] = '\0';
sendto_one(sptr, "%s", buf);
}