diff --git a/include/ircd/client.h b/include/ircd/client.h index 6298227d4..c376b263c 100644 --- a/include/ircd/client.h +++ b/include/ircd/client.h @@ -39,6 +39,8 @@ IRCD_EXCEPTION(client_error, disconnected) struct sock; struct client; +extern client *me; + std::shared_ptr shared_from(const client &); std::shared_ptr shared_from(client &); std::weak_ptr weak_from(const client &); diff --git a/include/ircd/ircd.h b/include/ircd/ircd.h index b71faaddf..6d45d0b11 100644 --- a/include/ircd/ircd.h +++ b/include/ircd/ircd.h @@ -34,9 +34,8 @@ #ifdef __cplusplus namespace ircd { -extern bool debugmode; -extern std::shared_ptr me; -extern bool main_exited; +extern bool debugmode; // Set by command line to indicate debug behavior +extern bool main_exited; // Set when main context has finished. // Set callback for when IRCd's main context has completed. using main_exit_cb = std::function; @@ -62,6 +61,7 @@ void stop(); +/* #ifdef __cplusplus namespace ircd { @@ -69,11 +69,11 @@ namespace ircd { struct SetOptions { - int maxclients; /* max clients allowed */ - int autoconn; /* autoconn enabled for all servers? */ + int maxclients; // max clients allowed + int autoconn; // autoconn enabled for all servers? - int floodcount; /* Number of messages in 1 second */ - int ident_timeout; /* timeout for identd lookups */ + int floodcount; // Number of messages in 1 second + int ident_timeout; // timeout for identd lookups int spam_num; int spam_time; @@ -84,15 +84,14 @@ struct SetOptions struct Counter { - int oper; /* Opers */ - int total; /* total clients */ - int invisi; /* invisible clients */ - int max_loc; /* MAX local clients */ - int max_tot; /* MAX global clients */ - unsigned long totalrestartcount; /* Total client count ever */ + int oper; // Opers + int total; // total clients + int invisi; // invisible clients + int max_loc; // MAX local clients + int max_tot; // MAX global clients + unsigned long totalrestartcount; // Total client count ever }; -/* extern struct SetOptions GlobalSetOptions; extern volatile sig_atomic_t dorehash; @@ -132,7 +131,8 @@ extern int maxconnections; void restart(const char *) __attribute__((noreturn)); void ircd_shutdown() __attribute__((noreturn)); void server_reboot(void) __attribute__((noreturn)); -*/ } // namespace ircd #endif // __cplusplus + +*/ diff --git a/ircd/client.cc b/ircd/client.cc index c8724c708..e04515823 100644 --- a/ircd/client.cc +++ b/ircd/client.cc @@ -44,6 +44,7 @@ struct client ~client() noexcept; }; +client *me; std::unique_ptr client_db; clist client_list; diff --git a/ircd/conf.cc b/ircd/conf.cc index 725503885..d33f1ee9b 100644 --- a/ircd/conf.cc +++ b/ircd/conf.cc @@ -76,11 +76,13 @@ try // Translate to oldconf and linefeed bootstrap(); +/* newconf::translate(newconf::current, [] (const std::string &line) { execute(line); }); +*/ } catch(const std::exception &e) { diff --git a/ircd/ircd.cc b/ircd/ircd.cc index bc082dd8a..88055757a 100644 --- a/ircd/ircd.cc +++ b/ircd/ircd.cc @@ -29,13 +29,13 @@ namespace ircd { - bool debugmode; // set by command line - boost::asio::io_service *ios; // user's io service - std::shared_ptr me; // That's me - main_exit_cb main_exit_func; // Called when main context exits - bool main_exited; // Set when IRCd is finished + bool debugmode; // set by command line + + boost::asio::io_service *ios; // user's io service bool main_finish; // Set by stop() to request main context exit + bool main_exited; // Set when IRCd is finished + main_exit_cb main_exit_func; // Called when main context exits ctx::ctx *main_context; // Reference to main context void seed_random(); @@ -235,12 +235,12 @@ rb_dlink_list global_client_list; */ /* unknown/client pointer lists */ -rb_dlink_list unknown_list; /* unknown clients ON this server only */ -rb_dlink_list lclient_list; /* local clients only ON this server */ -rb_dlink_list serv_list; /* local servers to this server ONLY */ -rb_dlink_list global_serv_list; /* global servers on the network */ -rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */ -rb_dlink_list oper_list; /* network opers */ +//rb_dlink_list unknown_list; /* unknown clients ON this server only */ +//rb_dlink_list lclient_list; /* local clients only ON this server */ +//rb_dlink_list serv_list; /* local servers to this server ONLY */ +//rb_dlink_list global_serv_list; /* global servers on the network */ +//rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */ +//rb_dlink_list oper_list; /* network opers */ /* char * const *myargv; @@ -300,10 +300,10 @@ check_rehash(void *unused) * output - none * side effects - This sets all global set options needed */ +/* static void initialize_global_set_options(void) { -/* memset(&GlobalSetOptions, 0, sizeof(GlobalSetOptions)); // memset( &ConfigFileEntry, 0, sizeof(ConfigFileEntry)); @@ -337,8 +337,8 @@ initialize_global_set_options(void) rb_strlcpy(GlobalSetOptions.adminstring, ConfigFileEntry.default_adminstring, sizeof(GlobalSetOptions.adminstring)); -*/ } +*/