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

+- Made except socks become except scan, and made it actually WORK, and some

+  bugreport fixes
This commit is contained in:
stskeeps
2001-09-01 13:27:17 +00:00
parent e04c12a2ea
commit 614e22400a
6 changed files with 84 additions and 27 deletions
+13 -9
View File
@@ -355,23 +355,27 @@ DLLFUNC int h_scan_connect(aClient *sptr)
vFP *vfp;
THREAD thread;
THREAD_ATTR thread_attr;
#ifdef INET6
char addrbuf[1024];
#ifndef INET6
strcpy(addrbuf, (char *)inet_ntoa(sptr->ip));
#else
inet_ntop(AFINET, (void *)&sptr->ip,
addrbuf, sizeof(addrbuf));
#endif
if (Find_except(addrbuf, 0))
return 0;
IRCMutexLock(HSlock);
HS_Cleanup((void *)1);
if (HS_Find((char *)inet_ntoa(sptr->ip)))
if (HS_Find(addrbuf))
{
/* Not gonna scan, already scanning */
IRCMutexUnlock(HSlock);
return 0;
}
#ifndef INET6
if (h = HS_Add((char *)inet_ntoa(sptr->ip)))
#else
if (h = HS_Add((char *) inet_ntop(AFINET, (void *)&sptr->ip,
addrbuf, sizeof(addrbuf))))
#endif
if (h = HS_Add(addrbuf))
{
/* Run scanning threads, refcnt++ for each thread that uses the struct */
/* Use hooks, making it easy, remember to convert to vFP */
@@ -390,7 +394,7 @@ DLLFUNC int h_scan_connect(aClient *sptr)
And run h_scan_connect again?. Is this too loopy?
*/
sendto_realops("Problem: We ran out of Host slots. Cannot scan %s. increase SCAN_AT_ONCE",
sptr->sockhost);
addrbuf);
IRCMutexUnlock(HSlock);
return 0;
}
+3 -3
View File
@@ -1953,14 +1953,14 @@ int _conf_except(ConfigFile *conf, ConfigEntry *ce)
ca->flag.type = 1;
add_ConfigItem((ConfigItem *)ca, (ConfigItem **) &conf_except);
}
else if (!strcmp(ce->ce_vardata, "socks")) {
else if (!strcmp(ce->ce_vardata, "scan")) {
for (cep = ce->ce_entries; cep; cep = cep->ce_next)
{
if (!strcmp(cep->ce_varname, "mask")) {
ca->mask = strdup(cep->ce_vardata);
}
else {
config_status("%s:%i: unknown directive except::socks::%s",
config_status("%s:%i: unknown directive except::scan::%s",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
cep->ce_varname);
}
@@ -3740,7 +3740,7 @@ ConfigItem_ulines *Find_uline(char *host) {
ConfigItem_except *Find_except(char *host, short type) {
ConfigItem_except *excepts;
if (!host || !type)
if (!host)
return NULL;
for(excepts = conf_except; excepts; excepts =(ConfigItem_except *) excepts->next) {