0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-27 07:54:05 +01:00

fixup! [temp] Checkpoint test.

This commit is contained in:
Jason Volk 2016-10-26 02:39:28 -07:00
parent 50e38b5a82
commit be48466ef3
5 changed files with 33 additions and 28 deletions

View file

@ -39,6 +39,8 @@ IRCD_EXCEPTION(client_error, disconnected)
struct sock; struct sock;
struct client; struct client;
extern client *me;
std::shared_ptr<const client> shared_from(const client &); std::shared_ptr<const client> shared_from(const client &);
std::shared_ptr<client> shared_from(client &); std::shared_ptr<client> shared_from(client &);
std::weak_ptr<const client> weak_from(const client &); std::weak_ptr<const client> weak_from(const client &);

View file

@ -34,9 +34,8 @@
#ifdef __cplusplus #ifdef __cplusplus
namespace ircd { namespace ircd {
extern bool debugmode; extern bool debugmode; // Set by command line to indicate debug behavior
extern std::shared_ptr<client> me; extern bool main_exited; // Set when main context has finished.
extern bool main_exited;
// Set callback for when IRCd's main context has completed. // Set callback for when IRCd's main context has completed.
using main_exit_cb = std::function<void ()>; using main_exit_cb = std::function<void ()>;
@ -62,6 +61,7 @@ void stop();
/*
#ifdef __cplusplus #ifdef __cplusplus
namespace ircd { namespace ircd {
@ -69,11 +69,11 @@ namespace ircd {
struct SetOptions struct SetOptions
{ {
int maxclients; /* max clients allowed */ int maxclients; // max clients allowed
int autoconn; /* autoconn enabled for all servers? */ int autoconn; // autoconn enabled for all servers?
int floodcount; /* Number of messages in 1 second */ int floodcount; // Number of messages in 1 second
int ident_timeout; /* timeout for identd lookups */ int ident_timeout; // timeout for identd lookups
int spam_num; int spam_num;
int spam_time; int spam_time;
@ -84,15 +84,14 @@ struct SetOptions
struct Counter struct Counter
{ {
int oper; /* Opers */ int oper; // Opers
int total; /* total clients */ int total; // total clients
int invisi; /* invisible clients */ int invisi; // invisible clients
int max_loc; /* MAX local clients */ int max_loc; // MAX local clients
int max_tot; /* MAX global clients */ int max_tot; // MAX global clients
unsigned long totalrestartcount; /* Total client count ever */ unsigned long totalrestartcount; // Total client count ever
}; };
/*
extern struct SetOptions GlobalSetOptions; extern struct SetOptions GlobalSetOptions;
extern volatile sig_atomic_t dorehash; extern volatile sig_atomic_t dorehash;
@ -132,7 +131,8 @@ extern int maxconnections;
void restart(const char *) __attribute__((noreturn)); void restart(const char *) __attribute__((noreturn));
void ircd_shutdown() __attribute__((noreturn)); void ircd_shutdown() __attribute__((noreturn));
void server_reboot(void) __attribute__((noreturn)); void server_reboot(void) __attribute__((noreturn));
*/
} // namespace ircd } // namespace ircd
#endif // __cplusplus #endif // __cplusplus
*/

View file

@ -44,6 +44,7 @@ struct client
~client() noexcept; ~client() noexcept;
}; };
client *me;
std::unique_ptr<db::handle> client_db; std::unique_ptr<db::handle> client_db;
clist client_list; clist client_list;

View file

@ -76,11 +76,13 @@ try
// Translate to oldconf and linefeed // Translate to oldconf and linefeed
bootstrap(); bootstrap();
/*
newconf::translate(newconf::current, [] newconf::translate(newconf::current, []
(const std::string &line) (const std::string &line)
{ {
execute(line); execute(line);
}); });
*/
} }
catch(const std::exception &e) catch(const std::exception &e)
{ {

View file

@ -30,12 +30,12 @@
namespace ircd namespace ircd
{ {
bool debugmode; // set by command line bool debugmode; // set by command line
boost::asio::io_service *ios; // user's io service boost::asio::io_service *ios; // user's io service
std::shared_ptr<client> me; // That's me
main_exit_cb main_exit_func; // Called when main context exits
bool main_exited; // Set when IRCd is finished
bool main_finish; // Set by stop() to request main context exit 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 ctx::ctx *main_context; // Reference to main context
void seed_random(); void seed_random();
@ -235,12 +235,12 @@ rb_dlink_list global_client_list;
*/ */
/* unknown/client pointer lists */ /* unknown/client pointer lists */
rb_dlink_list unknown_list; /* unknown clients ON this server only */ //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 lclient_list; /* local clients only ON this server */
rb_dlink_list serv_list; /* local servers to this server ONLY */ //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 global_serv_list; /* global servers on the network */
rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */ //rb_dlink_list local_oper_list; /* our opers, duplicated in lclient_list */
rb_dlink_list oper_list; /* network opers */ //rb_dlink_list oper_list; /* network opers */
/* /*
char * const *myargv; char * const *myargv;
@ -300,10 +300,10 @@ check_rehash(void *unused)
* output - none * output - none
* side effects - This sets all global set options needed * side effects - This sets all global set options needed
*/ */
/*
static void static void
initialize_global_set_options(void) initialize_global_set_options(void)
{ {
/*
memset(&GlobalSetOptions, 0, sizeof(GlobalSetOptions)); memset(&GlobalSetOptions, 0, sizeof(GlobalSetOptions));
// memset( &ConfigFileEntry, 0, sizeof(ConfigFileEntry)); // memset( &ConfigFileEntry, 0, sizeof(ConfigFileEntry));
@ -337,8 +337,8 @@ initialize_global_set_options(void)
rb_strlcpy(GlobalSetOptions.adminstring, rb_strlcpy(GlobalSetOptions.adminstring,
ConfigFileEntry.default_adminstring, ConfigFileEntry.default_adminstring,
sizeof(GlobalSetOptions.adminstring)); sizeof(GlobalSetOptions.adminstring));
*/
} }
*/