53 |
|
#include "s_log.h" |
54 |
|
#include "s_misc.h" |
55 |
|
#include "s_serv.h" /* try_connections */ |
56 |
– |
#include "s_stats.h" |
56 |
|
#include "send.h" |
57 |
|
#include "whowas.h" |
58 |
|
#include "modules.h" |
62 |
|
#include "balloc.h" |
63 |
|
#include "motd.h" |
64 |
|
#include "supported.h" |
65 |
+ |
#include "watch.h" |
66 |
|
|
67 |
|
/* Try and find the correct name to use with getrlimit() for setting the max. |
68 |
|
* number of files allowed to be open by this process. |
80 |
|
struct Counter Count = { 0, 0, 0, 0, 0, 0, 0, 0 }; |
81 |
|
struct ServerState_t server_state = { 0 }; |
82 |
|
struct logging_entry ConfigLoggingEntry = { 1, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0} }; |
83 |
+ |
struct ServerStatistics ServerStats; |
84 |
|
struct timeval SystemTime; |
85 |
|
struct Client me; /* That's me */ |
86 |
|
struct LocalUser meLocalUser; /* That's also part of me */ |
282 |
|
{ |
283 |
|
struct Client *client_p = ptr->data; |
284 |
|
assert(client_p->localClient->list_task); |
285 |
< |
safe_list_channels(client_p, client_p->localClient->list_task, 0, 0); |
285 |
> |
safe_list_channels(client_p, client_p->localClient->list_task, 0); |
286 |
|
} |
287 |
|
} |
288 |
|
|
381 |
|
initialize_server_capabs(void) |
382 |
|
{ |
383 |
|
add_capability("QS", CAP_QS, 1); |
383 |
– |
add_capability("LL", CAP_LL, 1); |
384 |
|
add_capability("EOB", CAP_EOB, 1); |
385 |
+ |
|
386 |
|
if (ServerInfo.sid != NULL) /* only enable TS6 if we have an SID */ |
387 |
|
add_capability("TS6", CAP_TS6, 0); |
388 |
+ |
|
389 |
|
add_capability("ZIP", CAP_ZIP, 0); |
390 |
|
add_capability("CLUSTER", CAP_CLUSTER, 1); |
391 |
|
#ifdef HALFOPS |
531 |
|
static void |
532 |
|
init_callbacks(void) |
533 |
|
{ |
534 |
< |
iorecv_cb = register_callback("iorecv", NULL); |
535 |
< |
iosend_cb = register_callback("iosend", NULL); |
534 |
> |
iorecv_cb = register_callback("iorecv", iorecv_default); |
535 |
> |
iosend_cb = register_callback("iosend", iosend_default); |
536 |
|
iorecvctrl_cb = register_callback("iorecvctrl", NULL); |
537 |
|
iosendctrl_cb = register_callback("iosendctrl", NULL); |
538 |
|
} |
569 |
|
of Client list */ |
570 |
|
|
571 |
|
memset(&ServerInfo, 0, sizeof(ServerInfo)); |
572 |
+ |
memset(&ServerStats, 0, sizeof(ServerStats)); |
573 |
|
|
574 |
|
/* Initialise the channel capability usage counts... */ |
575 |
|
init_chcap_usage_counts(); |
641 |
|
init_client(); |
642 |
|
init_class(); |
643 |
|
init_whowas(); |
644 |
< |
init_stats(); |
644 |
> |
watch_init(); |
645 |
|
read_conf_files(1); /* cold start init conf files */ |
643 |
– |
initServerMask(); |
646 |
|
me.id[0] = '\0'; |
647 |
|
init_uid(); |
648 |
|
init_auth(); /* Initialise the auth code */ |
658 |
|
ilog(L_CRIT, "No server name specified in serverinfo block."); |
659 |
|
exit(EXIT_FAILURE); |
660 |
|
} |
661 |
+ |
|
662 |
|
strlcpy(me.name, ServerInfo.name, sizeof(me.name)); |
663 |
|
|
664 |
|
/* serverinfo{} description must exist. If not, error out.*/ |
668 |
|
"ERROR: No server description specified in serverinfo block."); |
669 |
|
exit(EXIT_FAILURE); |
670 |
|
} |
671 |
+ |
|
672 |
|
strlcpy(me.info, ServerInfo.description, sizeof(me.info)); |
673 |
|
|
674 |
|
me.from = &me; |
731 |
|
eventAddIsh("check_splitmode", check_splitmode, NULL, 60); |
732 |
|
|
733 |
|
io_loop(); |
734 |
< |
return(0); |
734 |
> |
return 0; |
735 |
|
} |