mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-01 18:06:38 +02:00
Get rid of various never used config options and also port
the U4 fix for Windows where it says "Too many connections" way too quickly. (Sorry for mixing both in 1 commit..)
This commit is contained in:
@@ -350,7 +350,6 @@ extern aClient *make_client(aClient *, aClient *);
|
||||
extern Member *find_channel_link(Member *, aChannel *);
|
||||
extern char *pretty_mask(char *);
|
||||
extern void add_client_to_list(aClient *);
|
||||
extern void checklist();
|
||||
extern void remove_client_from_list(aClient *);
|
||||
extern void initlists();
|
||||
extern struct hostent *get_res(char *);
|
||||
|
||||
+3
-8
@@ -231,14 +231,9 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia
|
||||
/*
|
||||
** flags for bootup options (command line flags)
|
||||
*/
|
||||
#define BOOT_CONSOLE 1
|
||||
#define BOOT_QUICK 2
|
||||
#define BOOT_DEBUG 4
|
||||
#define BOOT_INETD 8
|
||||
#define BOOT_TTY 16
|
||||
#define BOOT_OPER 32
|
||||
#define BOOT_AUTODIE 64
|
||||
#define BOOT_NOFORK 128
|
||||
#define BOOT_DEBUG 1
|
||||
#define BOOT_TTY 2
|
||||
#define BOOT_NOFORK 4
|
||||
|
||||
#define STAT_LOG -7 /* logfile for -x */
|
||||
#define STAT_CONNECTING -6
|
||||
|
||||
@@ -481,6 +481,9 @@ void check_user_limit(void)
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
maxclients = MAXCONNECTIONS - CLIENTS_RESERVE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void init_sys(void)
|
||||
|
||||
+19
-70
@@ -72,7 +72,6 @@ MODVAR char **myargv;
|
||||
#else
|
||||
LPCSTR cmdLine;
|
||||
#endif
|
||||
int portnum = -1; /* Server port number, listening this */
|
||||
char *configfile = CONFIGFILE; /* Server configuration file */
|
||||
int debuglevel = 0; /* Server debug level */
|
||||
int bootopt = 0; /* Server boot option flags */
|
||||
@@ -622,18 +621,11 @@ static int bad_command(const char *argv0)
|
||||
argv0 = "unrealircd";
|
||||
|
||||
(void)printf
|
||||
("Usage: %s [-f <config>] [-h <servername>] [-p <port>] [-x <loglevel>] [-t] [-F]\n"
|
||||
("Usage: %s [-f <config>] [-F]\n"
|
||||
"\n"
|
||||
"UnrealIRCd\n"
|
||||
" -f <config> Load configuration from <config> instead of the default\n"
|
||||
" (%s).\n"
|
||||
" -h <servername> Override the me::name configuration setting with\n"
|
||||
" <servername>.\n"
|
||||
" -p <port> Listen on <port> in addition to the ports specified by\n"
|
||||
" the listen blocks.\n"
|
||||
" -x <loglevel> Set the log level to <loglevel>.\n"
|
||||
" -t Dump information to stdout as if you were a linked-in\n"
|
||||
" server.\n"
|
||||
" -F Don't fork() when starting up. Use this when running\n"
|
||||
" UnrealIRCd under gdb or when playing around with settings\n"
|
||||
" on a non-production setup.\n"
|
||||
@@ -643,7 +635,7 @@ static int bad_command(const char *argv0)
|
||||
#else
|
||||
if (!IsService) {
|
||||
MessageBox(NULL,
|
||||
"Usage: UnrealIRCd [-h servername] [-p portnumber] [-x loglevel]\n",
|
||||
"Usage: UnrealIRCd [-f configfile]\n",
|
||||
"UnrealIRCD/32", MB_OK);
|
||||
}
|
||||
#endif
|
||||
@@ -924,7 +916,6 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
#ifdef HAVE_PSTAT
|
||||
union pstun pstats;
|
||||
#endif
|
||||
int portarg = 0;
|
||||
#ifdef HAVE_SETRLIMIT
|
||||
struct rlimit corelim;
|
||||
#endif
|
||||
@@ -1026,40 +1017,22 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
} else
|
||||
p = "";
|
||||
}
|
||||
switch (flag) {
|
||||
switch (flag)
|
||||
{
|
||||
case 'F':
|
||||
bootopt |= BOOT_NOFORK;
|
||||
break;
|
||||
case 'f':
|
||||
#ifndef _WIN32
|
||||
case 'a':
|
||||
bootopt |= BOOT_AUTODIE;
|
||||
break;
|
||||
case 'c':
|
||||
bootopt |= BOOT_CONSOLE;
|
||||
break;
|
||||
case 'q':
|
||||
bootopt |= BOOT_QUICK;
|
||||
break;
|
||||
#endif
|
||||
case 'F':
|
||||
bootopt |= BOOT_NOFORK;
|
||||
break;
|
||||
#ifndef _WIN32
|
||||
case 'f':
|
||||
if ((uid == euid) && (gid == egid))
|
||||
configfile = strdup(p);
|
||||
else
|
||||
printf("ERROR: Command line config with a setuid/setgid ircd is not allowed");
|
||||
convert_to_absolute_path(&configfile, CONFDIR);
|
||||
break;
|
||||
case 'h':
|
||||
if (!strchr(p, '.')) {
|
||||
|
||||
(void)printf
|
||||
("ERROR: %s is not valid: Server names must contain at least 1 \".\"\n",
|
||||
p);
|
||||
exit(1);
|
||||
}
|
||||
strlcpy(me.name, p, sizeof(me.name));
|
||||
break;
|
||||
if ((uid != euid) || (gid != egid))
|
||||
{
|
||||
printf("ERROR: Command line config with a setuid/setgid ircd is not allowed");
|
||||
exit(1);
|
||||
}
|
||||
#endif
|
||||
configfile = strdup(p);
|
||||
convert_to_absolute_path(&configfile, CONFDIR);
|
||||
break;
|
||||
#ifndef _WIN32
|
||||
case 'P':{
|
||||
short type;
|
||||
@@ -1097,30 +1070,6 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
exit(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
case 'p':
|
||||
if ((portarg = atoi(p)) > 0)
|
||||
portnum = portarg;
|
||||
break;
|
||||
case 's':
|
||||
(void)printf("sizeof(aClient) == %ld\n",
|
||||
(long)sizeof(aClient));
|
||||
(void)printf("sizeof(aLocalClient) == %ld\n",
|
||||
(long)sizeof(aLocalClient));
|
||||
(void)printf("sizeof(anUser) == %ld\n",
|
||||
(long)sizeof(anUser));
|
||||
(void)printf("sizeof(aChannel) == %ld\n",
|
||||
(long)sizeof(aChannel));
|
||||
(void)printf("sizeof(aServer) == %ld\n",
|
||||
(long)sizeof(aServer));
|
||||
(void)printf("sizeof(Link) == %ld\n",
|
||||
(long)sizeof(Link));
|
||||
(void)printf("sizeof(aTKline) == %ld\n",
|
||||
(long)sizeof(aTKline));
|
||||
(void)printf("sizeof(struct ircstatsx) == %ld\n",
|
||||
(long)sizeof(struct ircstatsx));
|
||||
exit(0);
|
||||
break;
|
||||
#if 0
|
||||
case 'S':
|
||||
charsys_dump_table(p ? p : "*");
|
||||
@@ -1243,8 +1192,10 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
fprintf(stderr, "* %s\n", SSLeay_version(SSLEAY_VERSION));
|
||||
#ifdef USE_LIBCURL
|
||||
fprintf(stderr, "* %s\n", curl_version());
|
||||
#endif
|
||||
#endif
|
||||
check_user_limit();
|
||||
#ifndef _WIN32
|
||||
fprintf(stderr, "\n");
|
||||
fprintf(stderr, "This server can handle %d concurrent sockets (%d clients + %d reserve)\n\n",
|
||||
maxclients+CLIENTS_RESERVE, maxclients, CLIENTS_RESERVE);
|
||||
@@ -1309,9 +1260,7 @@ int InitUnrealIRCd(int argc, char *argv[])
|
||||
fprintf(stderr, "Dynamic configuration initialized.. booting IRCd.\n");
|
||||
#endif
|
||||
open_debugfile();
|
||||
if (portnum < 0)
|
||||
portnum = 6667;
|
||||
me.local->port = portnum;
|
||||
me.local->port = 6667; /* pointless? */
|
||||
(void)init_sys();
|
||||
applymeblock();
|
||||
#ifdef HAVE_SYSLOG
|
||||
|
||||
@@ -360,7 +360,6 @@ void remove_client_from_list(aClient *cptr)
|
||||
if (!list_empty(&cptr->id_hash))
|
||||
abort();
|
||||
(void)free_client(cptr);
|
||||
checklist();
|
||||
numclients--;
|
||||
return;
|
||||
}
|
||||
|
||||
-11
@@ -674,17 +674,6 @@ int exit_client(aClient *cptr, aClient *sptr, aClient *from, MessageTag *recv_mt
|
||||
return cptr == sptr ? FLUSH_BUFFER : 0;
|
||||
}
|
||||
|
||||
void checklist(void)
|
||||
{
|
||||
if (!(bootopt & BOOT_AUTODIE))
|
||||
return;
|
||||
|
||||
if (!list_empty(&lclient_list))
|
||||
exit (0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
void initstats(void)
|
||||
{
|
||||
bzero((char *)&ircst, sizeof(ircst));
|
||||
|
||||
Reference in New Issue
Block a user