Remove ^M on line endings.

This commit is contained in:
Jilles Tjoelker 2008-04-13 17:54:23 +02:00
parent c4633508ee
commit b717a466d0
20 changed files with 340 additions and 340 deletions

View File

@ -1,52 +1,52 @@
/* $Id: cache.h 24250 2007-08-22 19:15:08Z androsyn $ */ /* $Id: cache.h 24250 2007-08-22 19:15:08Z androsyn $ */
#ifndef INCLUDED_CACHE_H #ifndef INCLUDED_CACHE_H
#define INCLUDED_CACHE_H #define INCLUDED_CACHE_H
#define HELP_MAX 100 #define HELP_MAX 100
#define CACHELINELEN 81 #define CACHELINELEN 81
#define CACHEFILELEN 30 #define CACHEFILELEN 30
/* two servernames, a gecos, three spaces, ":1", '\0' */ /* two servernames, a gecos, three spaces, ":1", '\0' */
#define LINKSLINELEN (HOSTLEN + HOSTLEN + REALLEN + 6) #define LINKSLINELEN (HOSTLEN + HOSTLEN + REALLEN + 6)
#define HELP_USER 0x001 #define HELP_USER 0x001
#define HELP_OPER 0x002 #define HELP_OPER 0x002
struct Client; struct Client;
struct cachefile struct cachefile
{ {
char name[CACHEFILELEN]; char name[CACHEFILELEN];
rb_dlink_list contents; rb_dlink_list contents;
int flags; int flags;
}; };
struct cacheline struct cacheline
{ {
char data[CACHELINELEN]; char data[CACHELINELEN];
rb_dlink_node linenode; rb_dlink_node linenode;
}; };
extern struct cachefile *user_motd; extern struct cachefile *user_motd;
extern struct cachefile *oper_motd; extern struct cachefile *oper_motd;
extern struct cacheline *emptyline; extern struct cacheline *emptyline;
extern char user_motd_changed[MAX_DATE_STRING]; extern char user_motd_changed[MAX_DATE_STRING];
extern rb_dlink_list links_cache_list; extern rb_dlink_list links_cache_list;
void init_cache(void); void init_cache(void);
struct cachefile *cache_file(const char *, const char *, int); struct cachefile *cache_file(const char *, const char *, int);
void cache_links(void *unused); void cache_links(void *unused);
void free_cachefile(struct cachefile *); void free_cachefile(struct cachefile *);
void load_help(void); void load_help(void);
void send_user_motd(struct Client *); void send_user_motd(struct Client *);
void send_oper_motd(struct Client *); void send_oper_motd(struct Client *);
void cache_user_motd(void); void cache_user_motd(void);
struct Dictionary; struct Dictionary;
extern struct Dictionary *help_dict_oper; extern struct Dictionary *help_dict_oper;
extern struct Dictionary *help_dict_user; extern struct Dictionary *help_dict_user;
#endif #endif

View File

@ -111,11 +111,11 @@ struct Server
struct ZipStats struct ZipStats
{ {
unsigned long long in; unsigned long long in;
unsigned long long in_wire; unsigned long long in_wire;
unsigned long long out; unsigned long long out;
unsigned long long out_wire; unsigned long long out_wire;
double in_ratio; double in_ratio;
double out_ratio; double out_ratio;
}; };

View File

@ -64,8 +64,8 @@
/* Right out of the RFC */ /* Right out of the RFC */
#define IRCD_BUFSIZE 512 #define IRCD_BUFSIZE 512
/* readbuf size */ /* readbuf size */
#define READBUF_SIZE 16384 #define READBUF_SIZE 16384
#endif /* INCLUDED_common_h */ #endif /* INCLUDED_common_h */

View File

@ -45,7 +45,7 @@ extern struct Dictionary *nd_dict;
#define U_MAX_BITS 17 #define U_MAX_BITS 17
#define U_MAX 131072 /* 2^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 #define CLI_FD_MAX 4096
/* Channel hash table size, hash.c/s_debug.c */ /* 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 struct ConfItem *hash_find_resv(const char *name);
extern void clear_resv_hash(void); extern void clear_resv_hash(void);
void add_to_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); void del_from_cli_fd_hash(struct Client *client_p);
struct Client *find_cli_fd_hash(int fd); struct Client *find_cli_fd_hash(int fd);
extern void hash_stats(struct Client *); extern void hash_stats(struct Client *);

View File

@ -31,17 +31,17 @@
struct Client; struct Client;
struct Listener struct Listener
{ {
struct Listener *next; /* list node pointer */ struct Listener *next; /* list node pointer */
const char *name; /* listener name */ const char *name; /* listener name */
rb_fde_t *F; /* file descriptor */ rb_fde_t *F; /* file descriptor */
int ref_count; /* number of connection references */ int ref_count; /* number of connection references */
int active; /* current state of listener */ int active; /* current state of listener */
int ssl; /* ssl listener */ int ssl; /* ssl listener */
struct rb_sockaddr_storage addr; struct rb_sockaddr_storage addr;
struct DNSQuery *dns_query; struct DNSQuery *dns_query;
char vhost[HOSTLEN + 1]; /* virtual name of listener */ char vhost[HOSTLEN + 1]; /* virtual name of listener */
}; };
extern void add_listener(int port, const char *vaddr_ip, int family, int ssl); extern void add_listener(int port, const char *vaddr_ip, int family, int ssl);

View File

@ -19,9 +19,9 @@ struct monitor
rb_dlink_list users; rb_dlink_list users;
}; };
extern struct monitor *monitorTable[]; extern struct monitor *monitorTable[];
#define MONITOR_HASH_BITS 16 #define MONITOR_HASH_BITS 16
#define MONITOR_HASH_SIZE (1<<MONITOR_HASH_BITS) #define MONITOR_HASH_SIZE (1<<MONITOR_HASH_BITS)
void free_monitor(struct monitor *); void free_monitor(struct monitor *);

View File

@ -271,10 +271,10 @@ struct server_info
#ifdef RB_IPV6 #ifdef RB_IPV6
int specific_ipv6_vhost; int specific_ipv6_vhost;
#endif #endif
char *ssl_private_key; char *ssl_private_key;
char *ssl_ca_cert; char *ssl_ca_cert;
char *ssl_cert; char *ssl_cert;
char *ssl_dh_params; char *ssl_dh_params;
int ssld_count; int ssld_count;
}; };

View File

@ -45,9 +45,9 @@ struct ServerStatistics
unsigned int is_cl; /* number of client connections */ unsigned int is_cl; /* number of client connections */
unsigned int is_sv; /* number of server connections */ unsigned int is_sv; /* number of server connections */
unsigned int is_ni; /* connection but no idea who it was */ 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_cbs; /* bytes sent to clients */
unsigned long long int is_cbr; /* bytes received 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_sbs; /* bytes sent to servers */
unsigned long long int is_sbr; /* bytes received to servers */ unsigned long long int is_sbr; /* bytes received to servers */
time_t is_cti; /* time spent connected by clients */ time_t is_cti; /* time spent connected by clients */
time_t is_sti; /* time spent connected by servers */ time_t is_sti; /* time spent connected by servers */

View File

@ -174,13 +174,13 @@ mr_server(struct Client *client_p, struct Client *source_p, int parc, const char
/* NOT REACHED */ /* NOT REACHED */
break; break;
case -5: case -5:
sendto_realops_snomask(SNO_GENERAL, L_ALL, sendto_realops_snomask(SNO_GENERAL, L_ALL,
"Connection from servername %s requires SSL/TLS but is plaintext", "Connection from servername %s requires SSL/TLS but is plaintext",
name); name);
ilog(L_SERVER, "Access denied, requires SSL/TLS but is plaintext from %s", ilog(L_SERVER, "Access denied, requires SSL/TLS but is plaintext from %s",
log_client_name(client_p, SHOW_IP)); log_client_name(client_p, SHOW_IP));
exit_client(client_p, client_p, client_p, "Access denied, requires SSL/TLS but is plaintext"); exit_client(client_p, client_p, client_p, "Access denied, requires SSL/TLS but is plaintext");
return 0; return 0;
} }

View File

@ -98,12 +98,12 @@ mo_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
return 0; return 0;
} }
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count())) if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
{ {
sendto_one_notice(source_p, sendto_one_notice(source_p,
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.", ":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
parv[1]); parv[1]);
return 0; return 0;
} }
/* /*
@ -200,12 +200,12 @@ ms_connect(struct Client *client_p, struct Client *source_p, int parc, const cha
return 0; return 0;
} }
if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count())) if(ServerConfSSL(server_p) && (!ssl_ok || !get_ssld_count()))
{ {
sendto_one_notice(source_p, sendto_one_notice(source_p,
":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.", ":Connect: Server %s is set to use SSL/TLS but SSL/TLS is not configured.",
parv[1]); parv[1]);
return 0; return 0;
} }
/* /*

View File

@ -91,11 +91,11 @@ static struct InfoStruct info_table[] = {
&opers_see_all_users, &opers_see_all_users,
"Farconnect notices available or operspy accountability limited" "Farconnect notices available or operspy accountability limited"
}, },
{ {
"max_connections", "max_connections",
OUTPUT_DECIMAL, OUTPUT_DECIMAL,
&maxconnections, &maxconnections,
"Max number connections" "Max number connections"
}, },
{ {
"anti_nick_flood", "anti_nick_flood",

View File

@ -215,12 +215,12 @@ quote_max(struct Client *source_p, int newval)
{ {
if(newval > 0) if(newval > 0)
{ {
if(newval > maxconnections - MAX_BUFFER) if(newval > maxconnections - MAX_BUFFER)
{ {
sendto_one_notice(source_p, sendto_one_notice(source_p,
":You cannot set MAXCLIENTS to > %d", ":You cannot set MAXCLIENTS to > %d",
maxconnections - MAX_BUFFER); maxconnections - MAX_BUFFER);
return; return;
} }
if(newval < 32) if(newval < 32)

View File

@ -303,7 +303,7 @@ stats_connect(struct Client *source_p)
{ {
if(ServerConfAutoconn(server_p)) if(ServerConfAutoconn(server_p))
*s++ = 'A'; *s++ = 'A';
if(ServerConfSSL(server_p)) if(ServerConfSSL(server_p))
*s++ = 'S'; *s++ = 'S';
if(ServerConfTb(server_p)) if(ServerConfTb(server_p))
*s++ = 'T'; *s++ = 'T';
@ -848,24 +848,24 @@ stats_tstats (struct Client *source_p)
memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics)); memcpy(&sp, &ServerStats, sizeof(struct ServerStatistics));
RB_DLINK_FOREACH(ptr, serv_list.head) RB_DLINK_FOREACH(ptr, serv_list.head)
{ {
target_p = ptr->data; target_p = ptr->data;
sp.is_sbs += target_p->localClient->sendB; sp.is_sbs += target_p->localClient->sendB;
sp.is_sbr += target_p->localClient->receiveB; sp.is_sbr += target_p->localClient->receiveB;
sp.is_sti += rb_current_time() - target_p->localClient->firsttime; sp.is_sti += rb_current_time() - target_p->localClient->firsttime;
sp.is_sv++; sp.is_sv++;
} }
RB_DLINK_FOREACH(ptr, lclient_list.head) RB_DLINK_FOREACH(ptr, lclient_list.head)
{ {
target_p = ptr->data; target_p = ptr->data;
sp.is_cbs += target_p->localClient->sendB; sp.is_cbs += target_p->localClient->sendB;
sp.is_cbr += target_p->localClient->receiveB; sp.is_cbr += target_p->localClient->receiveB;
sp.is_cti += rb_current_time() - target_p->localClient->firsttime; sp.is_cti += rb_current_time() - target_p->localClient->firsttime;
sp.is_cl++; sp.is_cl++;
} }
RB_DLINK_FOREACH(ptr, unknown_list.head) 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 :Client Server");
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :connected %u %u", sp.is_cl, sp.is_sv); "T :connected %u %u", sp.is_cl, sp.is_sv);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :bytes sent %lluK %lluK", "T :bytes sent %lluK %lluK",
sp.is_cbs / 1024, sp.is_cbs / 1024,
sp.is_sbs / 1024); sp.is_sbs / 1024);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :bytes recv %lluK %lluK", "T :bytes recv %lluK %lluK",
sp.is_cbr / 1024, sp.is_cbr / 1024,
sp.is_sbr / 1024); sp.is_sbr / 1024);
sendto_one_numeric(source_p, RPL_STATSDEBUG, sendto_one_numeric(source_p, RPL_STATSDEBUG,
"T :time connected %lu %lu", "T :time connected %lu %lu",
(long int)sp.is_cti, (long int)sp.is_sti); (long int)sp.is_cti, (long int)sp.is_sti);
} }

View File

@ -1955,9 +1955,9 @@ close_connection(struct Client *client_p)
{ {
struct server_conf *server_p; struct server_conf *server_p;
ServerStats.is_sv++; ServerStats.is_sv++;
ServerStats.is_sbs += client_p->localClient->sendB; ServerStats.is_sbs += client_p->localClient->sendB;
ServerStats.is_sbr += client_p->localClient->receiveB; ServerStats.is_sbr += client_p->localClient->receiveB;
ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime; 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)) else if(IsClient(client_p))
{ {
ServerStats.is_cl++; ServerStats.is_cl++;
ServerStats.is_cbs += client_p->localClient->sendB; ServerStats.is_cbs += client_p->localClient->sendB;
ServerStats.is_cbr += client_p->localClient->receiveB; ServerStats.is_cbr += client_p->localClient->receiveB;
ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime; ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime;
} }
else else

View File

@ -664,35 +664,35 @@ clear_resv_hash(void)
HASH_WALK_END HASH_WALK_END
} }
void void
add_to_cli_fd_hash(struct Client *client_p) add_to_cli_fd_hash(struct Client *client_p)
{ {
rb_dlinkAddAlloc(client_p, &clientbyfdTable[hash_cli_fd(rb_get_fd(client_p->localClient->F))]); rb_dlinkAddAlloc(client_p, &clientbyfdTable[hash_cli_fd(rb_get_fd(client_p->localClient->F))]);
} }
void void
del_from_cli_fd_hash(struct Client *client_p) del_from_cli_fd_hash(struct Client *client_p)
{ {
unsigned int hashv; unsigned int hashv;
hashv = hash_cli_fd(rb_get_fd(client_p->localClient->F)); hashv = hash_cli_fd(rb_get_fd(client_p->localClient->F));
rb_dlinkFindDestroy(client_p, &clientbyfdTable[hashv]); rb_dlinkFindDestroy(client_p, &clientbyfdTable[hashv]);
} }
struct Client * struct Client *
find_cli_fd_hash(int fd) find_cli_fd_hash(int fd)
{ {
struct Client *target_p; struct Client *target_p;
rb_dlink_node *ptr; rb_dlink_node *ptr;
unsigned int hashv; unsigned int hashv;
hashv = hash_cli_fd(fd); hashv = hash_cli_fd(fd);
RB_DLINK_FOREACH(ptr, clientbyfdTable[hashv].head) RB_DLINK_FOREACH(ptr, clientbyfdTable[hashv].head)
{ {
target_p = ptr->data; target_p = ptr->data;
if(rb_get_fd(target_p->localClient->F) == fd) if(rb_get_fd(target_p->localClient->F) == fd)
return target_p; return target_p;
} }
return NULL; return NULL;
} }
static void static void

View File

@ -66,79 +66,79 @@
#include "serno.h" #include "serno.h"
#include "sslproc.h" #include "sslproc.h"
/* /quote set variables */ /* /quote set variables */
struct SetOptions GlobalSetOptions; struct SetOptions GlobalSetOptions;
/* configuration set from ircd.conf */ /* configuration set from ircd.conf */
struct config_file_entry ConfigFileEntry; struct config_file_entry ConfigFileEntry;
/* server info set from ircd.conf */ /* server info set from ircd.conf */
struct server_info ServerInfo; struct server_info ServerInfo;
/* admin info set from ircd.conf */ /* admin info set from ircd.conf */
struct admin_info AdminInfo; struct admin_info AdminInfo;
struct Counter Count; struct Counter Count;
struct ServerStatistics ServerStats; struct ServerStatistics ServerStats;
int maxconnections; int maxconnections;
struct timeval SystemTime; struct timeval SystemTime;
struct Client me; /* That's me */ struct Client me; /* That's me */
struct LocalUser meLocalUser; /* That's also part of me */ struct LocalUser meLocalUser; /* That's also part of me */
rb_dlink_list lclient_list = { NULL, NULL, 0 }; rb_dlink_list lclient_list = { NULL, NULL, 0 };
rb_dlink_list global_client_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 global_channel_list = { NULL, NULL, 0 };
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 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 */
time_t startup_time; time_t startup_time;
int default_server_capabs = CAP_MASK; int default_server_capabs = CAP_MASK;
int splitmode; int splitmode;
int splitchecking; int splitchecking;
int split_users; int split_users;
int split_servers; int split_servers;
int eob_count; int eob_count;
unsigned long initialVMTop = 0; /* top of virtual memory at init */ unsigned long initialVMTop = 0; /* top of virtual memory at init */
const char *logFileName = LPATH; const char *logFileName = LPATH;
const char *pidFileName = PPATH; const char *pidFileName = PPATH;
char **myargv; char **myargv;
int dorehash = 0; int dorehash = 0;
int dorehashbans = 0; int dorehashbans = 0;
int doremotd = 0; int doremotd = 0;
int kline_queued = 0; int kline_queued = 0;
int server_state_foreground = 0; int server_state_foreground = 0;
int opers_see_all_users = 0; int opers_see_all_users = 0;
int ssl_ok = 0; int ssl_ok = 0;
int zlib_ok = 1; int zlib_ok = 1;
int testing_conf = 0; int testing_conf = 0;
struct config_channel_entry ConfigChannel; struct config_channel_entry ConfigChannel;
rb_bh *channel_heap; rb_bh *channel_heap;
rb_bh *ban_heap; rb_bh *ban_heap;
rb_bh *topic_heap; rb_bh *topic_heap;
rb_bh *member_heap; rb_bh *member_heap;
rb_bh *client_heap = NULL; rb_bh *client_heap = NULL;
rb_bh *lclient_heap = NULL; rb_bh *lclient_heap = NULL;
rb_bh *pclient_heap = NULL; rb_bh *pclient_heap = NULL;
char current_uid[IDLEN]; char current_uid[IDLEN];
/* patricia */ /* patricia */
rb_bh *prefix_heap; rb_bh *prefix_heap;
rb_bh *node_heap; rb_bh *node_heap;
rb_bh *patricia_heap; rb_bh *patricia_heap;
rb_bh *linebuf_heap; rb_bh *linebuf_heap;
rb_bh *dnode_heap; rb_bh *dnode_heap;
/* /*
@ -185,7 +185,7 @@ ircd_restart_cb(const char *str)
static void static void
ircd_die_cb(const char *str) ircd_die_cb(const char *str)
{ {
if(str != NULL) if(str != NULL)
{ {
/* Try to get the message out to currently logged in operators. */ /* Try to get the message out to currently logged in operators. */
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Server panic! %s", str); sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Server panic! %s", str);
@ -206,21 +206,21 @@ ircd_die_cb(const char *str)
static void static void
init_sys(void) init_sys(void)
{ {
#if defined(RLIMIT_NOFILE) && defined(HAVE_SYS_RESOURCE_H) #if defined(RLIMIT_NOFILE) && defined(HAVE_SYS_RESOURCE_H)
struct rlimit limit; struct rlimit limit;
if(!getrlimit(RLIMIT_NOFILE, &limit)) if(!getrlimit(RLIMIT_NOFILE, &limit))
{ {
maxconnections = limit.rlim_cur; maxconnections = limit.rlim_cur;
if(maxconnections <= MAX_BUFFER) if(maxconnections <= MAX_BUFFER)
{ {
fprintf(stderr, "ERROR: Shell FD limits are too low.\n"); 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); fprintf(stderr, "ERROR: ircd-ratbox reserves %d FDs, shell limits must be above this\n", MAX_BUFFER);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
return; return;
} }
#endif /* RLIMIT_FD_MAX */ #endif /* RLIMIT_FD_MAX */
maxconnections = MAXCONNECTIONS; maxconnections = MAXCONNECTIONS;
} }
@ -333,9 +333,9 @@ 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)); */
GlobalSetOptions.maxclients = ServerInfo.default_max_clients; GlobalSetOptions.maxclients = ServerInfo.default_max_clients;
if(GlobalSetOptions.maxclients > (maxconnections - MAX_BUFFER) || (GlobalSetOptions.maxclients <= 0)) if(GlobalSetOptions.maxclients > (maxconnections - MAX_BUFFER) || (GlobalSetOptions.maxclients <= 0))
GlobalSetOptions.maxclients = maxconnections - MAX_BUFFER; GlobalSetOptions.maxclients = maxconnections - MAX_BUFFER;
GlobalSetOptions.autoconn = 1; GlobalSetOptions.autoconn = 1;
@ -645,16 +645,16 @@ main(int argc, char *argv[])
} }
strlcpy(me.info, ServerInfo.description, sizeof(me.info)); strlcpy(me.info, ServerInfo.description, sizeof(me.info));
if(ServerInfo.ssl_cert != NULL && ServerInfo.ssl_private_key != NULL) if(ServerInfo.ssl_cert != NULL && ServerInfo.ssl_private_key != NULL)
{ {
/* just do the rb_setup_ssl_server to validate the config */ /* 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)) if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))
{ {
ilog(L_MAIN, "WARNING: Unable to setup SSL."); ilog(L_MAIN, "WARNING: Unable to setup SSL.");
ssl_ok = 0; ssl_ok = 0;
} }
else else
ssl_ok = 1; ssl_ok = 1;
} }
if (testing_conf) if (testing_conf)

View File

@ -147,7 +147,7 @@ show_ports(struct Client *source_p)
ntohs(((struct sockaddr_in *)&listener->addr)->sin_port), ntohs(((struct sockaddr_in *)&listener->addr)->sin_port),
#endif #endif
IsOperAdmin(source_p) ? listener->name : me.name, IsOperAdmin(source_p) ? listener->name : me.name,
listener->ref_count, (listener->active) ? "active" : "disabled", listener->ref_count, (listener->active) ? "active" : "disabled",
listener->ssl ? " ssl" : ""); 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; new_client->localClient->F = F;
add_to_cli_fd_hash(new_client); add_to_cli_fd_hash(new_client);
new_client->localClient->listener = listener; new_client->localClient->listener = listener;
new_client->localClient->ssl_ctl = ssl_ctl; new_client->localClient->ssl_ctl = ssl_ctl;
if(ssl_ctl != NULL || rb_fd_ssl(F)) if(ssl_ctl != NULL || rb_fd_ssl(F))
SetSSL(new_client); SetSSL(new_client);
++listener->ref_count; ++listener->ref_count;
@ -487,10 +487,10 @@ accept_precallback(rb_fde_t *F, struct sockaddr *addr, rb_socklen_t addrlen, voi
struct ConfItem *aconf; struct ConfItem *aconf;
static time_t last_oper_notice = 0; static time_t last_oper_notice = 0;
if(listener->ssl && (!ssl_ok || !get_ssld_count())) if(listener->ssl && (!ssl_ok || !get_ssld_count()))
{ {
rb_close(F); rb_close(F);
return 0; return 0;
} }
if((maxconnections - 10) < rb_get_fd(F)) /* XXX this is kinda bogus */ 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; return 1;
} }
static void static void
accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct Listener *listener) accept_ssld(rb_fde_t *F, struct sockaddr *addr, struct sockaddr *laddr, struct Listener *listener)
{ {
ssl_ctl_t *ctl; ssl_ctl_t *ctl;
rb_fde_t *xF[2]; rb_fde_t *xF[2];
rb_socketpair(AF_UNIX, SOCK_STREAM, 0, &xF[0], &xF[1], "Incoming ssld Connection"); 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 */ 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); add_connection(listener, xF[0], addr, ctl, 1);
} }
static void static void
@ -569,8 +569,8 @@ accept_callback(rb_fde_t *F, int status, struct sockaddr *addr, rb_socklen_t add
rb_close(F); rb_close(F);
} }
if(listener->ssl) if(listener->ssl)
accept_ssld(F, addr, (struct sockaddr *)&lip, listener); accept_ssld(F, addr, (struct sockaddr *)&lip, listener);
else else
add_connection(listener, F, addr, NULL, 1); add_connection(listener, F, addr, NULL, 1);
} }

View File

@ -782,16 +782,16 @@ conf_set_listen_port_both(void *data, int ssl)
} }
} }
static void static void
conf_set_listen_port(void *data) conf_set_listen_port(void *data)
{ {
conf_set_listen_port_both(data, 0); conf_set_listen_port_both(data, 0);
} }
static void static void
conf_set_listen_sslport(void *data) conf_set_listen_sslport(void *data)
{ {
conf_set_listen_port_both(data, 1); conf_set_listen_port_both(data, 1);
} }
static void static void
@ -1164,12 +1164,12 @@ conf_end_connect(struct TopConf *tc)
yy_server->flags &= ~SERVER_COMPRESSED; yy_server->flags &= ~SERVER_COMPRESSED;
} }
#endif #endif
if(ServerConfCompressed(yy_server) && ServerConfSSL(yy_server)) if(ServerConfCompressed(yy_server) && ServerConfSSL(yy_server))
{ {
conf_report_error("Ignoring compressed for connect block %s -- " conf_report_error("Ignoring compressed for connect block %s -- "
"ssl and compressed are mutually exclusive (OpenSSL does its own compression)", "ssl and compressed are mutually exclusive (OpenSSL does its own compression)",
yy_server->name); yy_server->name);
yy_server->flags &= ~SERVER_COMPRESSED; yy_server->flags &= ~SERVER_COMPRESSED;
} }
add_server_conf(yy_server); add_server_conf(yy_server);
@ -1914,10 +1914,10 @@ static struct ConfEntry conf_serverinfo_table[] =
{ "vhost", CF_QSTRING, conf_set_serverinfo_vhost, 0, NULL }, { "vhost", CF_QSTRING, conf_set_serverinfo_vhost, 0, NULL },
{ "vhost6", CF_QSTRING, conf_set_serverinfo_vhost6, 0, NULL }, { "vhost6", CF_QSTRING, conf_set_serverinfo_vhost6, 0, NULL },
{ "ssl_private_key", CF_QSTRING, NULL, 0, &ServerInfo.ssl_private_key }, { "ssl_private_key", CF_QSTRING, NULL, 0, &ServerInfo.ssl_private_key },
{ "ssl_ca_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_ca_cert }, { "ssl_ca_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_ca_cert },
{ "ssl_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_cert }, { "ssl_cert", CF_QSTRING, NULL, 0, &ServerInfo.ssl_cert },
{ "ssl_dh_params", CF_QSTRING, NULL, 0, &ServerInfo.ssl_dh_params }, { "ssl_dh_params", CF_QSTRING, NULL, 0, &ServerInfo.ssl_dh_params },
{ "ssld_count", CF_INT, NULL, 0, &ServerInfo.ssld_count }, { "ssld_count", CF_INT, NULL, 0, &ServerInfo.ssld_count },
{ "default_max_clients",CF_INT, NULL, 0, &ServerInfo.default_max_clients }, { "default_max_clients",CF_INT, NULL, 0, &ServerInfo.default_max_clients },

View File

@ -865,24 +865,24 @@ validate_conf(void)
if(ServerInfo.network_desc == NULL) if(ServerInfo.network_desc == NULL)
ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT); ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
if(ServerInfo.ssld_count < 1) if(ServerInfo.ssld_count < 1)
ServerInfo.ssld_count = 1; ServerInfo.ssld_count = 1;
if(!rb_setup_ssl_server(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."); ilog(L_MAIN, "WARNING: Unable to setup SSL.");
ssl_ok = 0; ssl_ok = 0;
} else { } else {
ssl_ok = 1; ssl_ok = 1;
send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params); send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);
} }
if(ServerInfo.ssld_count > get_ssld_count()) if(ServerInfo.ssld_count > get_ssld_count())
{ {
int start = ServerInfo.ssld_count - get_ssld_count(); int start = ServerInfo.ssld_count - get_ssld_count();
/* start up additional ssld if needed */ /* start up additional ssld if needed */
start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params); start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);
} }
if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) || if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||

View File

@ -149,12 +149,12 @@ send_queued(struct Client *to)
if(IsIOError(to)) if(IsIOError(to))
return; return;
/* Something wants us to not send anything currently */ /* Something wants us to not send anything currently */
/* if(IsCork(to)) /* if(IsCork(to))
return; */ return; */
/* try to flush later when the write event resets this */ /* try to flush later when the write event resets this */
if(IsFlush(to)) if(IsFlush(to))
return; return;
#ifdef USE_IODEBUG_HOOKS #ifdef USE_IODEBUG_HOOKS
@ -204,25 +204,25 @@ send_queued(struct Client *to)
} }
} }
if(rb_linebuf_len(&to->localClient->buf_sendq)) if(rb_linebuf_len(&to->localClient->buf_sendq))
{ {
SetFlush(to); SetFlush(to);
rb_setselect(to->localClient->F, RB_SELECT_WRITE, rb_setselect(to->localClient->F, RB_SELECT_WRITE,
send_queued_write, to); send_queued_write, to);
} }
else else
ClearFlush(to); ClearFlush(to);
} }
void void
send_pop_queue(struct Client *to) send_pop_queue(struct Client *to)
{ {
if(to->from != NULL) if(to->from != NULL)
to = to->from; to = to->from;
if(!MyConnect(to) || IsIOError(to)) if(!MyConnect(to) || IsIOError(to))
return; return;
if(rb_linebuf_len(&to->localClient->buf_sendq) > 0) if(rb_linebuf_len(&to->localClient->buf_sendq) > 0)
send_queued(to); send_queued(to);
} }
/* send_queued_write() /* send_queued_write()