| 45 |
|
#include "s_conf.h" |
| 46 |
|
#include "parse_aline.h" |
| 47 |
|
#include "s_serv.h" |
| 48 |
– |
#include "s_stats.h" |
| 48 |
|
#include "send.h" |
| 49 |
|
#include "whowas.h" |
| 50 |
< |
#include "modules.h" |
| 50 |
> |
#include "conf/modules.h" |
| 51 |
|
#include "ircd_getopt.h" |
| 52 |
|
#include "motd.h" |
| 53 |
|
#include "supported.h" |
| 59 |
|
|
| 60 |
|
/* /quote set variables */ |
| 61 |
|
struct SetOptions GlobalSetOptions; |
| 62 |
< |
|
| 62 |
> |
struct ServerStatistics ServerStats; |
| 63 |
|
/* configuration set from ircd.conf */ |
| 64 |
|
struct config_file_entry ConfigFileEntry; |
| 65 |
|
/* server info set from ircd.conf */ |
| 82 |
|
|
| 83 |
|
int dorehash = 0; |
| 84 |
|
int doremotd = 0; |
| 86 |
– |
time_t nextconnect = 1; /* time for next try_connections call */ |
| 85 |
|
|
| 86 |
|
/* Set to zero because it should be initialized later using |
| 87 |
|
* initialize_server_capabs |
| 130 |
|
*/ |
| 131 |
|
|
| 132 |
|
void *vptr = sbrk(0); |
| 133 |
< |
return((unsigned long)vptr); |
| 133 |
> |
return (unsigned long)vptr; |
| 134 |
|
} |
| 135 |
|
|
| 136 |
|
/* |
| 248 |
|
rehash(1); |
| 249 |
|
dorehash = 0; |
| 250 |
|
} |
| 251 |
+ |
|
| 252 |
|
if (doremotd) |
| 253 |
|
{ |
| 254 |
|
read_message_file(&ConfigFileEntry.motd); |
| 297 |
|
GlobalSetOptions.ident_timeout = IDENT_TIMEOUT; |
| 298 |
|
GlobalSetOptions.idletime = ConfigFileEntry.idletime; |
| 299 |
|
GlobalSetOptions.maxlisters = 10; /* XXX ya ya ya - db */ |
| 301 |
– |
/* End of global set options */ |
| 300 |
|
} |
| 301 |
|
|
| 302 |
|
/* initialize_message_files() |
| 360 |
|
pid, filename, strerror(errno)); |
| 361 |
|
|
| 362 |
|
fbclose(fb); |
| 365 |
– |
return; |
| 363 |
|
} |
| 364 |
|
else |
| 365 |
|
{ |
| 445 |
|
init_ssl(void) |
| 446 |
|
{ |
| 447 |
|
#ifdef HAVE_LIBCRYPTO |
| 448 |
+ |
SSL_library_init(); |
| 449 |
|
SSL_load_error_strings(); |
| 452 |
– |
SSLeay_add_ssl_algorithms(); |
| 450 |
|
|
| 451 |
|
ServerInfo.ctx = SSL_CTX_new(SSLv23_server_method()); |
| 452 |
+ |
|
| 453 |
|
if (!ServerInfo.ctx) |
| 454 |
|
{ |
| 455 |
|
const char *s; |
| 513 |
|
EXTERN int |
| 514 |
|
main(int argc, char *argv[]) |
| 515 |
|
{ |
| 516 |
< |
/* Check to see if the user is running |
| 517 |
< |
* us as root, which is a nono |
| 516 |
> |
/* |
| 517 |
> |
* Check to see if the user is running us as root, which is a nono |
| 518 |
|
*/ |
| 519 |
|
#ifndef _WIN32 |
| 520 |
|
if (geteuid() == 0) |
| 531 |
|
#endif |
| 532 |
|
|
| 533 |
|
memset(&ServerInfo, 0, sizeof(ServerInfo)); |
| 534 |
+ |
memset(&ServerStats, 0, sizeof(ServerStats)); |
| 535 |
|
|
| 536 |
|
ConfigFileEntry.dpath = DPATH; |
| 537 |
|
ConfigFileEntry.configfile = CPATH; /* Server configuration file */ |
| 582 |
|
/* make_dlink_node() cannot be called until after libio_init() */ |
| 583 |
|
memset(&me, 0, sizeof(me)); |
| 584 |
|
memset(&meLocalUser, 0, sizeof(meLocalUser)); |
| 585 |
+ |
|
| 586 |
|
me.localClient = &meLocalUser; |
| 587 |
|
me.from = me.servptr = &me; |
| 588 |
|
me.lasttime = me.since = me.firsttime = CurrentTime; |
| 601 |
|
init_client(); |
| 602 |
|
init_class(); |
| 603 |
|
init_whowas(); |
| 604 |
– |
init_stats(); |
| 604 |
|
init_auth(); /* Initialise the auth code */ |
| 605 |
|
init_channels(); |
| 606 |
|
init_channel_modes(); |
| 612 |
|
|
| 613 |
|
if (ServerInfo.name == NULL) |
| 614 |
|
{ |
| 615 |
< |
ilog(L_CRIT, "No server name specified in serverinfo block."); |
| 615 |
> |
ilog(L_CRIT, "ERROR: No server name specified in serverinfo block."); |
| 616 |
|
exit(EXIT_FAILURE); |
| 617 |
|
} |
| 618 |
+ |
|
| 619 |
|
strlcpy(me.name, ServerInfo.name, sizeof(me.name)); |
| 620 |
|
|
| 621 |
|
/* serverinfo{} description must exist. If not, error out.*/ |
| 625 |
|
"ERROR: No server description specified in serverinfo block."); |
| 626 |
|
exit(EXIT_FAILURE); |
| 627 |
|
} |
| 628 |
+ |
|
| 629 |
|
strlcpy(me.info, ServerInfo.description, sizeof(me.info)); |
| 630 |
|
|
| 631 |
|
hash_add_client(&me); |
| 640 |
|
exit(EXIT_FAILURE); |
| 641 |
|
} |
| 642 |
|
|
| 643 |
< |
load_all_modules(1); |
| 643 |
< |
load_conf_modules(); |
| 644 |
< |
load_core_modules(1); |
| 643 |
> |
boot_modules(1); |
| 644 |
|
|
| 645 |
|
/* Go back to DPATH after checking to see if we can chdir to MODPATH */ |
| 646 |
|
chdir(ConfigFileEntry.dpath); |
| 679 |
|
eventAddIsh("check_splitmode", check_splitmode, NULL, 60); |
| 680 |
|
|
| 681 |
|
io_loop(); |
| 682 |
< |
return(0); |
| 682 |
> |
return 0; |
| 683 |
|
} |
| 684 |
|
|
| 685 |
|
#else |