1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-06 16:13:12 +02:00

+- Fixed some scan-socks and blackhole fuckups

This commit is contained in:
stskeeps
2001-06-17 17:02:09 +00:00
parent ca95bdbbed
commit 00ed3759bb
3 changed files with 24 additions and 5 deletions
+1
View File
@@ -575,3 +575,4 @@ seen. gmtime warning still there
- Fixed a codemastr screwup in quarantine code
- Removed the old SOCKS check code.
- Fixed a quarantine bug
- Fixed some scan-socks and blackhole fuckups
+16 -4
View File
@@ -103,8 +103,18 @@ void blackhole_load(void)
if (!blackhole_conf.ip || !blackhole_conf.port)
{
config_error("set::blackhole: missing ip/port mask");
return 0;
}
if (blackhole_stop == 1)
{
sendto_realops("blackhole is already running, restarting module..");
blackhole_stop = 2;
while (blackhole_stop == 2) {}
}
blackhole_stop = 0;
IRCCreateThread(thread, thread_attr, blackhole, NULL);
while (blackhole_stop == 1) {}
}
@@ -116,8 +126,8 @@ DLLFUNC void mod_unload(void)
void blackhole_unload(void)
#endif
{
blackhole_stop = 1;
while (blackhole_stop == 1) {}
blackhole_stop = 2;
while (blackhole_stop == 2) {}
del_Hook(HOOKTYPE_CONFIG_UNKNOWN, h_config_set_blackhole);
}
@@ -202,13 +212,15 @@ DLLFUNC void blackhole(void *p)
listen(blackholefd, LISTEN_SIZE);
while (!blackhole_stop)
/* We hereby indicate that we are set up*/
blackhole_stop = 1;
while (blackhole_stop != 2)
{
callerfd = accept(blackholefd, NULL, NULL);
CLOSE_SOCK(callerfd);
}
end:
CLOSE_SOCK(blackholefd)
blackhole_stop = 0;
IRCExitThread(NULL);
}
+7 -1
View File
@@ -96,11 +96,17 @@ void scan_socks_init(void)
if (!xHSlock || !xVSlock || !xVS_add)
{
module_buffer = NULL;
config_error("scan_socks: i depend on scan.so");
config_error("scan_socks: i depend on scan.so being loaded");
return;
}
blackhole_conf = (ConfigItem_blackhole *) module_sym("blackhole_conf");
if (!blackhole_conf)
{
module_buffer = NULL;
config_error("scan_socks: i depend on blackhole.so being loaded");
return;
}
module_buffer = &scan_socks_info;
/*