Remove ^M on line endings.
This commit is contained in:
parent
c4633508ee
commit
b717a466d0
104
include/cache.h
104
include/cache.h
|
@ -1,52 +1,52 @@
|
|||
/* $Id: cache.h 24250 2007-08-22 19:15:08Z androsyn $ */
|
||||
#ifndef INCLUDED_CACHE_H
|
||||
#define INCLUDED_CACHE_H
|
||||
|
||||
#define HELP_MAX 100
|
||||
|
||||
#define CACHELINELEN 81
|
||||
#define CACHEFILELEN 30
|
||||
/* two servernames, a gecos, three spaces, ":1", '\0' */
|
||||
#define LINKSLINELEN (HOSTLEN + HOSTLEN + REALLEN + 6)
|
||||
|
||||
#define HELP_USER 0x001
|
||||
#define HELP_OPER 0x002
|
||||
|
||||
struct Client;
|
||||
|
||||
struct cachefile
|
||||
{
|
||||
char name[CACHEFILELEN];
|
||||
rb_dlink_list contents;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct cacheline
|
||||
{
|
||||
char data[CACHELINELEN];
|
||||
rb_dlink_node linenode;
|
||||
};
|
||||
|
||||
extern struct cachefile *user_motd;
|
||||
extern struct cachefile *oper_motd;
|
||||
extern struct cacheline *emptyline;
|
||||
|
||||
extern char user_motd_changed[MAX_DATE_STRING];
|
||||
extern rb_dlink_list links_cache_list;
|
||||
|
||||
void init_cache(void);
|
||||
struct cachefile *cache_file(const char *, const char *, int);
|
||||
void cache_links(void *unused);
|
||||
void free_cachefile(struct cachefile *);
|
||||
|
||||
void load_help(void);
|
||||
|
||||
void send_user_motd(struct Client *);
|
||||
void send_oper_motd(struct Client *);
|
||||
void cache_user_motd(void);
|
||||
|
||||
struct Dictionary;
|
||||
extern struct Dictionary *help_dict_oper;
|
||||
extern struct Dictionary *help_dict_user;
|
||||
#endif
|
||||
|
||||
/* $Id: cache.h 24250 2007-08-22 19:15:08Z androsyn $ */
|
||||
#ifndef INCLUDED_CACHE_H
|
||||
#define INCLUDED_CACHE_H
|
||||
|
||||
#define HELP_MAX 100
|
||||
|
||||
#define CACHELINELEN 81
|
||||
#define CACHEFILELEN 30
|
||||
/* two servernames, a gecos, three spaces, ":1", '\0' */
|
||||
#define LINKSLINELEN (HOSTLEN + HOSTLEN + REALLEN + 6)
|
||||
|
||||
#define HELP_USER 0x001
|
||||
#define HELP_OPER 0x002
|
||||
|
||||
struct Client;
|
||||
|
||||
struct cachefile
|
||||
{
|
||||
char name[CACHEFILELEN];
|
||||
rb_dlink_list contents;
|
||||
int flags;
|
||||
};
|
||||
|
||||
struct cacheline
|
||||
{
|
||||
char data[CACHELINELEN];
|
||||
rb_dlink_node linenode;
|
||||
};
|
||||
|
||||
extern struct cachefile *user_motd;
|
||||
extern struct cachefile *oper_motd;
|
||||
extern struct cacheline *emptyline;
|
||||
|
||||
extern char user_motd_changed[MAX_DATE_STRING];
|
||||
extern rb_dlink_list links_cache_list;
|
||||
|
||||
void init_cache(void);
|
||||
struct cachefile *cache_file(const char *, const char *, int);
|
||||
void cache_links(void *unused);
|
||||
void free_cachefile(struct cachefile *);
|
||||
|
||||
void load_help(void);
|
||||
|
||||
void send_user_motd(struct Client *);
|
||||
void send_oper_motd(struct Client *);
|
||||
void cache_user_motd(void);
|
||||
|
||||
struct Dictionary;
|
||||
extern struct Dictionary *help_dict_oper;
|
||||
extern struct Dictionary *help_dict_user;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -111,11 +111,11 @@ struct Server
|
|||
|
||||
struct ZipStats
|
||||
{
|
||||
unsigned long long in;
|
||||
unsigned long long in_wire;
|
||||
unsigned long long out;
|
||||
unsigned long long out_wire;
|
||||
double in_ratio;
|
||||
unsigned long long in;
|
||||
unsigned long long in_wire;
|
||||
unsigned long long out;
|
||||
unsigned long long out_wire;
|
||||
double in_ratio;
|
||||
double out_ratio;
|
||||
};
|
||||
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
|
||||
/* Right out of the RFC */
|
||||
#define IRCD_BUFSIZE 512
|
||||
|
||||
/* readbuf size */
|
||||
|
||||
/* readbuf size */
|
||||
#define READBUF_SIZE 16384
|
||||
|
||||
#endif /* INCLUDED_common_h */
|
||||
|
|
|
@ -45,7 +45,7 @@ extern struct Dictionary *nd_dict;
|
|||
#define U_MAX_BITS 17
|
||||
#define U_MAX 131072 /* 2^17 */
|
||||
|
||||
/* Client fd hash table size, used in hash.c */
|
||||
/* Client fd hash table size, used in hash.c */
|
||||
#define CLI_FD_MAX 4096
|
||||
|
||||
/* Channel hash table size, hash.c/s_debug.c */
|
||||
|
@ -101,8 +101,8 @@ extern void del_from_resv_hash(const char *name, struct ConfItem *aconf);
|
|||
extern struct ConfItem *hash_find_resv(const char *name);
|
||||
extern void clear_resv_hash(void);
|
||||
|
||||
void add_to_cli_fd_hash(struct Client *client_p);
|
||||
void del_from_cli_fd_hash(struct Client *client_p);
|
||||
void add_to_cli_fd_hash(struct Client *client_p);
|
||||
void del_from_cli_fd_hash(struct Client *client_p);
|
||||
struct Client *find_cli_fd_hash(int fd);
|
||||
|
||||
extern void hash_stats(struct Client *);
|
||||
|
|
|
@ -31,17 +31,17 @@
|
|||
|
||||
struct Client;
|
||||
|
||||
struct Listener
|
||||
{
|
||||
struct Listener *next; /* list node pointer */
|
||||
const char *name; /* listener name */
|
||||
rb_fde_t *F; /* file descriptor */
|
||||
int ref_count; /* number of connection references */
|
||||
int active; /* current state of listener */
|
||||
int ssl; /* ssl listener */
|
||||
struct rb_sockaddr_storage addr;
|
||||
struct DNSQuery *dns_query;
|
||||
char vhost[HOSTLEN + 1]; /* virtual name of listener */
|
||||
struct Listener
|
||||
{
|
||||
struct Listener *next; /* list node pointer */
|
||||
const char *name; /* listener name */
|
||||
rb_fde_t *F; /* file descriptor */
|
||||
int ref_count; /* number of connection references */
|
||||
int active; /* current state of listener */
|
||||
int ssl; /* ssl listener */
|
||||
struct rb_sockaddr_storage addr;
|
||||
struct DNSQuery *dns_query;
|
||||
char vhost[HOSTLEN + 1]; /* virtual name of listener */
|
||||
};
|
||||
|
||||
extern void add_listener(int port, const char *vaddr_ip, int family, int ssl);
|
||||
|
|
|
@ -19,9 +19,9 @@ struct monitor
|
|||
rb_dlink_list users;
|
||||
};
|
||||
|
||||
extern struct monitor *monitorTable[];
|
||||
|
||||
#define MONITOR_HASH_BITS 16
|
||||
extern struct monitor *monitorTable[];
|
||||
|
||||
#define MONITOR_HASH_BITS 16
|
||||
#define MONITOR_HASH_SIZE (1<<MONITOR_HASH_BITS)
|
||||
|
||||
void free_monitor(struct monitor *);
|
||||
|
|
|
@ -271,10 +271,10 @@ struct server_info
|
|||
#ifdef RB_IPV6
|
||||
int specific_ipv6_vhost;
|
||||
#endif
|
||||
char *ssl_private_key;
|
||||
char *ssl_ca_cert;
|
||||
char *ssl_cert;
|
||||
char *ssl_dh_params;
|
||||
char *ssl_private_key;
|
||||
char *ssl_ca_cert;
|
||||
char *ssl_cert;
|
||||
char *ssl_dh_params;
|
||||
int ssld_count;
|
||||
};
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@ struct ServerStatistics
|
|||
unsigned int is_cl; /* number of client connections */
|
||||
unsigned int is_sv; /* number of server connections */
|
||||
unsigned int is_ni; /* connection but no idea who it was */
|
||||
unsigned long long int is_cbs; /* bytes sent to clients */
|
||||
unsigned long long int is_cbr; /* bytes received to clients */
|
||||
unsigned long long int is_sbs; /* bytes sent to servers */
|
||||
unsigned long long int is_cbs; /* bytes sent to clients */
|
||||
unsigned long long int is_cbr; /* bytes received to clients */
|
||||
unsigned long long int is_sbs; /* bytes sent to servers */
|
||||
unsigned long long int is_sbr; /* bytes received to servers */
|
||||
time_t is_cti; /* time spent connected by clients */
|
||||
time_t is_sti; /* time spent connected by servers */
|
||||
|
|
|
@ -174,13 +174,13 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
|
|||
/* NOT REACHED */
|
||||
break;
|
||||
case -5:
|
||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||
"Connection from servername %s requires SSL/TLS but is plaintext",
|
||||
name);
|
||||
ilog(L_SERVER, "Access denied, requires SSL/TLS but is plaintext from %s",
|
||||
log_client_name(client_p, SHOW_IP));
|
||||
|
||||
exit_client(client_p, client_p, client_p, "Access denied, requires SSL/TLS but is plaintext");
|
||||
sendto_realops_snomask(SNO_GENERAL, L_ALL,
|
||||
"Connection from servername %s requires SSL/TLS but is plaintext",
|
||||
name);
|
||||
ilog(L_SERVER, "Access denied, requires SSL/TLS but is plaintext from %s",
|
||||
log_client_name(client_p, SHOW_IP));
|
||||
|
||||
exit_client(client_p, client_p, client_p, "Access denied, requires SSL/TLS but is plaintext");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,12 +98,12 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
|
|||
return 0;
|
||||
}
|
||||
|
||||
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
|
||||
{
|
||||
sendto_one_notice(source_p,
|
||||
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
||||
parv[1]);
|
||||
return 0;
|
||||
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
|
||||
{
|
||||
sendto_one_notice(source_p,
|
||||
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
||||
parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -200,12 +200,12 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
|
|||
return 0;
|
||||
}
|
||||
|
||||
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
|
||||
{
|
||||
sendto_one_notice(source_p,
|
||||
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
||||
parv[1]);
|
||||
return 0;
|
||||
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
|
||||
{
|
||||
sendto_one_notice(source_p,
|
||||
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
|
||||
parv[1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -91,11 +91,11 @@ static struct InfoStruct info_table[] = {
|
|||
&opers_see_all_users,
|
||||
"Farconnect notices available or operspy accountability limited"
|
||||
},
|
||||
{
|
||||
"max_connections",
|
||||
OUTPUT_DECIMAL,
|
||||
&maxconnections,
|
||||
"Max number connections"
|
||||
{
|
||||
"max_connections",
|
||||
OUTPUT_DECIMAL,
|
||||
&maxconnections,
|
||||
"Max number connections"
|
||||
},
|
||||
{
|
||||
"anti_nick_flood",
|
||||
|
|
|
@ -215,12 +215,12 @@ quote_max(struct Client *source_p, int newval)
|
|||
{
|
||||
if(newval > 0)
|
||||
{
|
||||
if(newval > maxconnections - MAX_BUFFER)
|
||||
{
|
||||
sendto_one_notice(source_p,
|
||||
":You cannot set MAXCLIENTS to > %d",
|
||||
maxconnections - MAX_BUFFER);
|
||||
return;
|
||||
if(newval > maxconnections - MAX_BUFFER)
|
||||
{
|
||||
sendto_one_notice(source_p,
|
||||
":You cannot set MAXCLIENTS to > %d",
|
||||
maxconnections - MAX_BUFFER);
|
||||
return;
|
||||
}
|
||||
|
||||
if(newval < 32)
|
||||
|
|
|
@ -303,7 +303,7 @@ stats_connect(struct Client *source_p)
|
|||
{
|
||||
if(ServerConfAutoconn(server_p))
|
||||
*s++ = 'A';
|
||||
if(ServerConfSSL(server_p))
|
||||
if(ServerConfSSL(server_p))
|
||||
*s++ = 'S';
|
||||
if(ServerConfTb(server_p))
|
||||
*s++ = 'T';
|
||||
|
@ -848,24 +848,24 @@ stats_tstats (struct Client *source_p)
|
|||
|
||||
memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));
|
||||
|
||||
RB_DLINK_FOREACH(ptr, serv_list.head)
|
||||
{
|
||||
target_p = ptr->data;
|
||||
|
||||
sp.is_sbs += target_p->localClient->sendB;
|
||||
sp.is_sbr += target_p->localClient->receiveB;
|
||||
sp.is_sti += rb_current_time() - target_p->localClient->firsttime;
|
||||
sp.is_sv++;
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH(ptr, lclient_list.head)
|
||||
{
|
||||
target_p = ptr->data;
|
||||
|
||||
sp.is_cbs += target_p->localClient->sendB;
|
||||
sp.is_cbr += target_p->localClient->receiveB;
|
||||
sp.is_cti += rb_current_time() - target_p->localClient->firsttime;
|
||||
sp.is_cl++;
|
||||
RB_DLINK_FOREACH(ptr, serv_list.head)
|
||||
{
|
||||
target_p = ptr->data;
|
||||
|
||||
sp.is_sbs += target_p->localClient->sendB;
|
||||
sp.is_sbr += target_p->localClient->receiveB;
|
||||
sp.is_sti += rb_current_time() - target_p->localClient->firsttime;
|
||||
sp.is_sv++;
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH(ptr, lclient_list.head)
|
||||
{
|
||||
target_p = ptr->data;
|
||||
|
||||
sp.is_cbs += target_p->localClient->sendB;
|
||||
sp.is_cbr += target_p->localClient->receiveB;
|
||||
sp.is_cti += rb_current_time() - target_p->localClient->firsttime;
|
||||
sp.is_cl++;
|
||||
}
|
||||
|
||||
RB_DLINK_FOREACH(ptr, unknown_list.head)
|
||||
|
@ -904,16 +904,16 @@ stats_tstats (struct Client *source_p)
|
|||
sendto_one_numeric(source_p, RPL_STATSDEBUG, "T :Client Server");
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :connected %u %u", sp.is_cl, sp.is_sv);
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :bytes sent %lluK %lluK",
|
||||
sp.is_cbs / 1024,
|
||||
sp.is_sbs / 1024);
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :bytes recv %lluK %lluK",
|
||||
sp.is_cbr / 1024,
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :bytes sent %lluK %lluK",
|
||||
sp.is_cbs / 1024,
|
||||
sp.is_sbs / 1024);
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :bytes recv %lluK %lluK",
|
||||
sp.is_cbr / 1024,
|
||||
sp.is_sbr / 1024);
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :time connected %lu %lu",
|
||||
sendto_one_numeric(source_p, RPL_STATSDEBUG,
|
||||
"T :time connected %lu %lu",
|
||||
(long int)sp.is_cti, (long int)sp.is_sti);
|
||||
}
|
||||
|
||||
|
|
12
src/client.c
12
src/client.c
|
@ -1955,9 +1955,9 @@ close_connection(struct Client *client_p)
|
|||
{
|
||||
struct server_conf *server_p;
|
||||
|
||||
ServerStats.is_sv++;
|
||||
ServerStats.is_sbs += client_p->localClient->sendB;
|
||||
ServerStats.is_sbr += client_p->localClient->receiveB;
|
||||
ServerStats.is_sv++;
|
||||
ServerStats.is_sbs += client_p->localClient->sendB;
|
||||
ServerStats.is_sbr += client_p->localClient->receiveB;
|
||||
ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime;
|
||||
|
||||
/*
|
||||
|
@ -1981,9 +1981,9 @@ close_connection(struct Client *client_p)
|
|||
}
|
||||
else if(IsClient(client_p))
|
||||
{
|
||||
ServerStats.is_cl++;
|
||||
ServerStats.is_cbs += client_p->localClient->sendB;
|
||||
ServerStats.is_cbr += client_p->localClient->receiveB;
|
||||
ServerStats.is_cl++;
|
||||
ServerStats.is_cbs += client_p->localClient->sendB;
|
||||
ServerStats.is_cbr += client_p->localClient->receiveB;
|
||||
ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime;
|
||||
}
|
||||
else
|
||||
|
|
58
src/hash.c
58
src/hash.c
|
@ -664,35 +664,35 @@ clear_resv_hash(void)
|
|||
HASH_WALK_END
|
||||
}
|
||||
|
||||
void
|
||||
add_to_cli_fd_hash(struct Client *client_p)
|
||||
{
|
||||
rb_dlinkAddAlloc(client_p, &clientbyfdTable[hash_cli_fd(rb_get_fd(client_p->localClient->F))]);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
del_from_cli_fd_hash(struct Client *client_p)
|
||||
{
|
||||
unsigned int hashv;
|
||||
hashv = hash_cli_fd(rb_get_fd(client_p->localClient->F));
|
||||
rb_dlinkFindDestroy(client_p, &clientbyfdTable[hashv]);
|
||||
}
|
||||
|
||||
struct Client *
|
||||
find_cli_fd_hash(int fd)
|
||||
{
|
||||
struct Client *target_p;
|
||||
rb_dlink_node *ptr;
|
||||
unsigned int hashv;
|
||||
hashv = hash_cli_fd(fd);
|
||||
RB_DLINK_FOREACH(ptr, clientbyfdTable[hashv].head)
|
||||
{
|
||||
target_p = ptr->data;
|
||||
if(rb_get_fd(target_p->localClient->F) == fd)
|
||||
return target_p;
|
||||
}
|
||||
return NULL;
|
||||
void
|
||||
add_to_cli_fd_hash(struct Client *client_p)
|
||||
{
|
||||
rb_dlinkAddAlloc(client_p, &clientbyfdTable[hash_cli_fd(rb_get_fd(client_p->localClient->F))]);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
del_from_cli_fd_hash(struct Client *client_p)
|
||||
{
|
||||
unsigned int hashv;
|
||||
hashv = hash_cli_fd(rb_get_fd(client_p->localClient->F));
|
||||
rb_dlinkFindDestroy(client_p, &clientbyfdTable[hashv]);
|
||||
}
|
||||
|
||||
struct Client *
|
||||
find_cli_fd_hash(int fd)
|
||||
{
|
||||
struct Client *target_p;
|
||||
rb_dlink_node *ptr;
|
||||
unsigned int hashv;
|
||||
hashv = hash_cli_fd(fd);
|
||||
RB_DLINK_FOREACH(ptr, clientbyfdTable[hashv].head)
|
||||
{
|
||||
target_p = ptr->data;
|
||||
if(rb_get_fd(target_p->localClient->F) == fd)
|
||||
return target_p;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
176
src/ircd.c
176
src/ircd.c
|
@ -66,79 +66,79 @@
|
|||
#include "serno.h"
|
||||
#include "sslproc.h"
|
||||
|
||||
/* /quote set variables */
|
||||
/* /quote set variables */
|
||||
struct SetOptions GlobalSetOptions;
|
||||
|
||||
/* configuration set from ircd.conf */
|
||||
struct config_file_entry ConfigFileEntry;
|
||||
/* server info set from ircd.conf */
|
||||
struct server_info ServerInfo;
|
||||
/* admin info set from ircd.conf */
|
||||
|
||||
/* configuration set from ircd.conf */
|
||||
struct config_file_entry ConfigFileEntry;
|
||||
/* server info set from ircd.conf */
|
||||
struct server_info ServerInfo;
|
||||
/* admin info set from ircd.conf */
|
||||
struct admin_info AdminInfo;
|
||||
|
||||
struct Counter Count;
|
||||
struct Counter Count;
|
||||
struct ServerStatistics ServerStats;
|
||||
|
||||
int maxconnections;
|
||||
struct timeval SystemTime;
|
||||
struct Client me; /* That's me */
|
||||
struct Client me; /* That's me */
|
||||
struct LocalUser meLocalUser; /* That's also part of me */
|
||||
|
||||
rb_dlink_list lclient_list = { NULL, NULL, 0 };
|
||||
rb_dlink_list global_client_list = { NULL, NULL, 0 };
|
||||
rb_dlink_list global_channel_list = { NULL, NULL, 0 };
|
||||
|
||||
rb_dlink_list unknown_list; /* unknown clients ON 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 local_oper_list; /* our opers, duplicated in lclient_list */
|
||||
rb_dlink_list lclient_list = { NULL, NULL, 0 };
|
||||
rb_dlink_list global_client_list = { NULL, NULL, 0 };
|
||||
rb_dlink_list global_channel_list = { NULL, NULL, 0 };
|
||||
|
||||
rb_dlink_list unknown_list; /* unknown clients ON 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 local_oper_list; /* our opers, duplicated in lclient_list */
|
||||
rb_dlink_list oper_list; /* network opers */
|
||||
|
||||
time_t startup_time;
|
||||
|
||||
int default_server_capabs = CAP_MASK;
|
||||
|
||||
int splitmode;
|
||||
int splitchecking;
|
||||
int split_users;
|
||||
int split_servers;
|
||||
int eob_count;
|
||||
|
||||
unsigned long initialVMTop = 0; /* top of virtual memory at init */
|
||||
const char *logFileName = LPATH;
|
||||
time_t startup_time;
|
||||
|
||||
int default_server_capabs = CAP_MASK;
|
||||
|
||||
int splitmode;
|
||||
int splitchecking;
|
||||
int split_users;
|
||||
int split_servers;
|
||||
int eob_count;
|
||||
|
||||
unsigned long initialVMTop = 0; /* top of virtual memory at init */
|
||||
const char *logFileName = LPATH;
|
||||
const char *pidFileName = PPATH;
|
||||
|
||||
char **myargv;
|
||||
int dorehash = 0;
|
||||
int dorehashbans = 0;
|
||||
int doremotd = 0;
|
||||
int kline_queued = 0;
|
||||
int server_state_foreground = 0;
|
||||
int opers_see_all_users = 0;
|
||||
int ssl_ok = 0;
|
||||
int zlib_ok = 1;
|
||||
|
||||
int testing_conf = 0;
|
||||
|
||||
struct config_channel_entry ConfigChannel;
|
||||
rb_bh *channel_heap;
|
||||
rb_bh *ban_heap;
|
||||
rb_bh *topic_heap;
|
||||
rb_bh *member_heap;
|
||||
|
||||
rb_bh *client_heap = NULL;
|
||||
rb_bh *lclient_heap = NULL;
|
||||
rb_bh *pclient_heap = NULL;
|
||||
|
||||
char current_uid[IDLEN];
|
||||
|
||||
/* patricia */
|
||||
rb_bh *prefix_heap;
|
||||
rb_bh *node_heap;
|
||||
rb_bh *patricia_heap;
|
||||
|
||||
rb_bh *linebuf_heap;
|
||||
|
||||
int dorehash = 0;
|
||||
int dorehashbans = 0;
|
||||
int doremotd = 0;
|
||||
int kline_queued = 0;
|
||||
int server_state_foreground = 0;
|
||||
int opers_see_all_users = 0;
|
||||
int ssl_ok = 0;
|
||||
int zlib_ok = 1;
|
||||
|
||||
int testing_conf = 0;
|
||||
|
||||
struct config_channel_entry ConfigChannel;
|
||||
rb_bh *channel_heap;
|
||||
rb_bh *ban_heap;
|
||||
rb_bh *topic_heap;
|
||||
rb_bh *member_heap;
|
||||
|
||||
rb_bh *client_heap = NULL;
|
||||
rb_bh *lclient_heap = NULL;
|
||||
rb_bh *pclient_heap = NULL;
|
||||
|
||||
char current_uid[IDLEN];
|
||||
|
||||
/* patricia */
|
||||
rb_bh *prefix_heap;
|
||||
rb_bh *node_heap;
|
||||
rb_bh *patricia_heap;
|
||||
|
||||
rb_bh *linebuf_heap;
|
||||
|
||||
rb_bh *dnode_heap;
|
||||
|
||||
/*
|
||||
|
@ -185,7 +185,7 @@ ircd_restart_cb(const char *str)
|
|||
static void
|
||||
ircd_die_cb(const char *str)
|
||||
{
|
||||
if(str != NULL)
|
||||
if(str != NULL)
|
||||
{
|
||||
/* Try to get the message out to currently logged in operators. */
|
||||
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Server panic! %s", str);
|
||||
|
@ -206,21 +206,21 @@ ircd_die_cb(const char *str)
|
|||
static void
|
||||
init_sys(void)
|
||||
{
|
||||
#if defined(RLIMIT_NOFILE) && defined(HAVE_SYS_RESOURCE_H)
|
||||
struct rlimit limit;
|
||||
|
||||
if(!getrlimit(RLIMIT_NOFILE, &limit))
|
||||
{
|
||||
maxconnections = limit.rlim_cur;
|
||||
if(maxconnections <= MAX_BUFFER)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Shell FD limits are too low.\n");
|
||||
fprintf(stderr, "ERROR: ircd-ratbox reserves %d FDs, shell limits must be above this\n", MAX_BUFFER);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif /* RLIMIT_FD_MAX */
|
||||
#if defined(RLIMIT_NOFILE) && defined(HAVE_SYS_RESOURCE_H)
|
||||
struct rlimit limit;
|
||||
|
||||
if(!getrlimit(RLIMIT_NOFILE, &limit))
|
||||
{
|
||||
maxconnections = limit.rlim_cur;
|
||||
if(maxconnections <= MAX_BUFFER)
|
||||
{
|
||||
fprintf(stderr, "ERROR: Shell FD limits are too low.\n");
|
||||
fprintf(stderr, "ERROR: ircd-ratbox reserves %d FDs, shell limits must be above this\n", MAX_BUFFER);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif /* RLIMIT_FD_MAX */
|
||||
maxconnections = MAXCONNECTIONS;
|
||||
}
|
||||
|
||||
|
@ -333,9 +333,9 @@ initialize_global_set_options(void)
|
|||
memset(&GlobalSetOptions, 0, sizeof(GlobalSetOptions));
|
||||
/* memset( &ConfigFileEntry, 0, sizeof(ConfigFileEntry)); */
|
||||
|
||||
GlobalSetOptions.maxclients = ServerInfo.default_max_clients;
|
||||
|
||||
if(GlobalSetOptions.maxclients > (maxconnections - MAX_BUFFER) || (GlobalSetOptions.maxclients <= 0))
|
||||
GlobalSetOptions.maxclients = ServerInfo.default_max_clients;
|
||||
|
||||
if(GlobalSetOptions.maxclients > (maxconnections - MAX_BUFFER) || (GlobalSetOptions.maxclients <= 0))
|
||||
GlobalSetOptions.maxclients = maxconnections - MAX_BUFFER;
|
||||
|
||||
GlobalSetOptions.autoconn = 1;
|
||||
|
@ -645,16 +645,16 @@ main(int argc, char *argv[])
|
|||
}
|
||||
strlcpy(me.info, ServerInfo.description, sizeof(me.info));
|
||||
|
||||
if(ServerInfo.ssl_cert != NULL && ServerInfo.ssl_private_key != NULL)
|
||||
{
|
||||
/* just do the rb_setup_ssl_server to validate the config */
|
||||
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))
|
||||
{
|
||||
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
||||
ssl_ok = 0;
|
||||
}
|
||||
else
|
||||
ssl_ok = 1;
|
||||
if(ServerInfo.ssl_cert != NULL && ServerInfo.ssl_private_key != NULL)
|
||||
{
|
||||
/* just do the rb_setup_ssl_server to validate the config */
|
||||
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))
|
||||
{
|
||||
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
||||
ssl_ok = 0;
|
||||
}
|
||||
else
|
||||
ssl_ok = 1;
|
||||
}
|
||||
|
||||
if (testing_conf)
|
||||
|
|
|
@ -147,7 +147,7 @@ show_ports(struct Client *source_p)
|
|||
ntohs(((struct sockaddr_in *)&listener->addr)->sin_port),
|
||||
#endif
|
||||
IsOperAdmin(source_p) ? listener->name : me.name,
|
||||
listener->ref_count, (listener->active) ? "active" : "disabled",
|
||||
listener->ref_count, (listener->active) ? "active" : "disabled",
|
||||
listener->ssl ? " ssl" : "");
|
||||
}
|
||||
}
|
||||
|
@ -462,8 +462,8 @@ add_connection(struct Listener *listener, rb_fde_t *F, struct sockaddr *sai, voi
|
|||
new_client->localClient->F = F;
|
||||
add_to_cli_fd_hash(new_client);
|
||||
new_client->localClient->listener = listener;
|
||||
new_client->localClient->ssl_ctl = ssl_ctl;
|
||||
if(ssl_ctl != NULL || rb_fd_ssl(F))
|
||||
new_client->localClient->ssl_ctl = ssl_ctl;
|
||||
if(ssl_ctl != NULL || rb_fd_ssl(F))
|
||||
SetSSL(new_client);
|
||||
|
||||
++listener->ref_count;
|
||||
|
@ -487,10 +487,10 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
|
|||
struct ConfItem *aconf;
|
||||
static time_t last_oper_notice = 0;
|
||||
|
||||
if(listener->ssl && (!ssl_ok || !get_ssld_count()))
|
||||
{
|
||||
rb_close(F);
|
||||
return 0;
|
||||
if(listener->ssl && (!ssl_ok || !get_ssld_count()))
|
||||
{
|
||||
rb_close(F);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if((maxconnections - 10) < rb_get_fd(F)) /* XXX this is kinda bogus */
|
||||
|
@ -543,14 +543,14 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
|
|||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct Listener *listener)
|
||||
{
|
||||
ssl_ctl_t *ctl;
|
||||
rb_fde_t *xF[2];
|
||||
rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection");
|
||||
ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */
|
||||
add_connection(listener, xF[0], addr, ctl, 1);
|
||||
static void
|
||||
accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct Listener *listener)
|
||||
{
|
||||
ssl_ctl_t *ctl;
|
||||
rb_fde_t *xF[2];
|
||||
rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection");
|
||||
ctl = start_ssld_accept(F, xF[1], rb_get_fd(xF[0])); /* this will close F for us */
|
||||
add_connection(listener, xF[0], addr, ctl, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -569,8 +569,8 @@ accept_callback(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t add
|
|||
rb_close(F);
|
||||
}
|
||||
|
||||
if(listener->ssl)
|
||||
accept_ssld(F, addr, (struct sockaddr *)&lip, listener);
|
||||
else
|
||||
if(listener->ssl)
|
||||
accept_ssld(F, addr, (struct sockaddr *)&lip, listener);
|
||||
else
|
||||
add_connection(listener, F, addr, NULL, 1);
|
||||
}
|
||||
|
|
|
@ -782,16 +782,16 @@ conf_set_listen_port_both(void *data, int ssl)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
conf_set_listen_port(void *data)
|
||||
{
|
||||
conf_set_listen_port_both(data, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
conf_set_listen_sslport(void *data)
|
||||
{
|
||||
conf_set_listen_port_both(data, 1);
|
||||
static void
|
||||
conf_set_listen_port(void *data)
|
||||
{
|
||||
conf_set_listen_port_both(data, 0);
|
||||
}
|
||||
|
||||
static void
|
||||
conf_set_listen_sslport(void *data)
|
||||
{
|
||||
conf_set_listen_port_both(data, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1164,12 +1164,12 @@ conf_end_connect(struct TopConf *tc)
|
|||
yy_server->flags &= ~SERVER_COMPRESSED;
|
||||
}
|
||||
#endif
|
||||
if(ServerConfCompressed(yy_server) && ServerConfSSL(yy_server))
|
||||
{
|
||||
conf_report_error("Ignoring compressed for connect block %s -- "
|
||||
"ssl and compressed are mutually exclusive (OpenSSL does its own compression)",
|
||||
yy_server->name);
|
||||
yy_server->flags &= ~SERVER_COMPRESSED;
|
||||
if(ServerConfCompressed(yy_server) && ServerConfSSL(yy_server))
|
||||
{
|
||||
conf_report_error("Ignoring compressed for connect block %s -- "
|
||||
"ssl and compressed are mutually exclusive (OpenSSL does its own compression)",
|
||||
yy_server->name);
|
||||
yy_server->flags &= ~SERVER_COMPRESSED;
|
||||
}
|
||||
|
||||
add_server_conf(yy_server);
|
||||
|
@ -1914,10 +1914,10 @@ static struct ConfEntry conf_serverinfo_table[] =
|
|||
{ "vhost", CF_QSTRING, conf_set_serverinfo_vhost, 0, NULL },
|
||||
{ "vhost6", CF_QSTRING, conf_set_serverinfo_vhost6, 0, NULL },
|
||||
|
||||
{ "ssl_private_key", CF_QSTRING, NULL, 0, &ServerInfo.ssl_private_key },
|
||||
{ "ssl_ca_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_ca_cert },
|
||||
{ "ssl_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_cert },
|
||||
{ "ssl_dh_params", CF_QSTRING, NULL, 0, &ServerInfo.ssl_dh_params },
|
||||
{ "ssl_private_key", CF_QSTRING, NULL, 0, &ServerInfo.ssl_private_key },
|
||||
{ "ssl_ca_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_ca_cert },
|
||||
{ "ssl_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_cert },
|
||||
{ "ssl_dh_params", CF_QSTRING, NULL, 0, &ServerInfo.ssl_dh_params },
|
||||
{ "ssld_count", CF_INT, NULL, 0, &ServerInfo.ssld_count },
|
||||
|
||||
{ "default_max_clients",CF_INT, NULL, 0, &ServerInfo.default_max_clients },
|
||||
|
|
32
src/s_conf.c
32
src/s_conf.c
|
@ -865,24 +865,24 @@ validate_conf(void)
|
|||
if(ServerInfo.network_desc == NULL)
|
||||
ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
|
||||
|
||||
if(ServerInfo.ssld_count < 1)
|
||||
if(ServerInfo.ssld_count < 1)
|
||||
ServerInfo.ssld_count = 1;
|
||||
|
||||
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))
|
||||
{
|
||||
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
||||
ssl_ok = 0;
|
||||
} else {
|
||||
ssl_ok = 1;
|
||||
send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);
|
||||
}
|
||||
|
||||
if(ServerInfo.ssld_count > get_ssld_count())
|
||||
{
|
||||
int start = ServerInfo.ssld_count - get_ssld_count();
|
||||
/* start up additional ssld if needed */
|
||||
start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);
|
||||
|
||||
if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))
|
||||
{
|
||||
ilog(L_MAIN, "WARNING: Unable to setup SSL.");
|
||||
ssl_ok = 0;
|
||||
} else {
|
||||
ssl_ok = 1;
|
||||
send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);
|
||||
}
|
||||
|
||||
if(ServerInfo.ssld_count > get_ssld_count())
|
||||
{
|
||||
int start = ServerInfo.ssld_count - get_ssld_count();
|
||||
/* start up additional ssld if needed */
|
||||
start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);
|
||||
|
||||
}
|
||||
|
||||
if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||
|
||||
|
|
44
src/send.c
44
src/send.c
|
@ -149,12 +149,12 @@ send_queued(struct Client *to)
|
|||
if(IsIOError(to))
|
||||
return;
|
||||
|
||||
/* Something wants us to not send anything currently */
|
||||
/* if(IsCork(to))
|
||||
return; */
|
||||
|
||||
/* try to flush later when the write event resets this */
|
||||
if(IsFlush(to))
|
||||
/* Something wants us to not send anything currently */
|
||||
/* if(IsCork(to))
|
||||
return; */
|
||||
|
||||
/* try to flush later when the write event resets this */
|
||||
if(IsFlush(to))
|
||||
return;
|
||||
|
||||
#ifdef USE_IODEBUG_HOOKS
|
||||
|
@ -204,25 +204,25 @@ send_queued(struct Client *to)
|
|||
}
|
||||
}
|
||||
|
||||
if(rb_linebuf_len(&to->localClient->buf_sendq))
|
||||
{
|
||||
SetFlush(to);
|
||||
rb_setselect(to->localClient->F, RB_SELECT_WRITE,
|
||||
send_queued_write, to);
|
||||
}
|
||||
else
|
||||
if(rb_linebuf_len(&to->localClient->buf_sendq))
|
||||
{
|
||||
SetFlush(to);
|
||||
rb_setselect(to->localClient->F, RB_SELECT_WRITE,
|
||||
send_queued_write, to);
|
||||
}
|
||||
else
|
||||
ClearFlush(to);
|
||||
}
|
||||
|
||||
void
|
||||
send_pop_queue(struct Client *to)
|
||||
{
|
||||
if(to->from != NULL)
|
||||
to = to->from;
|
||||
if(!MyConnect(to) || IsIOError(to))
|
||||
return;
|
||||
if(rb_linebuf_len(&to->localClient->buf_sendq) > 0)
|
||||
send_queued(to);
|
||||
void
|
||||
send_pop_queue(struct Client *to)
|
||||
{
|
||||
if(to->from != NULL)
|
||||
to = to->from;
|
||||
if(!MyConnect(to) || IsIOError(to))
|
||||
return;
|
||||
if(rb_linebuf_len(&to->localClient->buf_sendq) > 0)
|
||||
send_queued(to);
|
||||
}
|
||||
|
||||
/* send_queued_write()
|
||||
|
|
Loading…
Reference in New Issue