Trying to migrate on ratbox3's listener.

This commit is contained in:
Valery Yatsko 2008-04-02 06:25:08 +04:00
parent f503e634fd
commit ae9fc63bfd
4 changed files with 535 additions and 563 deletions

View File

@ -609,7 +609,7 @@ extern void close_connection(struct Client *);
extern void init_uid(void); extern void init_uid(void);
extern char *generate_uid(void); extern char *generate_uid(void);
void allocate_away(struct Client *); void allocate_away(struct Client *);
void free_away(struct Client *); void free_away(struct Client *);
#endif /* INCLUDED_client_h */ #endif /* INCLUDED_client_h */

View File

@ -29,26 +29,25 @@
#include "ircd_defs.h" #include "ircd_defs.h"
struct Client; struct Client;
struct Listener struct Listener
{ {
struct Listener *next; /* list node pointer */ rb_dlink_node node;
const char *name; /* listener name */ const char *name; /* listener name */
int fd; /* 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 index; /* index into poll array */ int ssl; /* ssl listener */
struct irc_sockaddr_storage addr; struct rb_sockaddr_storage addr;
struct DNSQuery *dns_query; char vhost[HOSTLEN + 1]; /* virtual name of listener */
char vhost[HOSTLEN + 1]; /* virtual name of listener */ };
};
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); void close_listener(struct Listener *listener);
extern void close_listener(struct Listener *listener); void close_listeners(void);
extern void close_listeners(void); const char *get_listener_name(struct Listener *listener);
extern const char *get_listener_name(const struct Listener *listener); void show_ports(struct Client *client);
extern void show_ports(struct Client *client); void free_listener(struct Listener *);
extern void free_listener(struct Listener *);
#endif /* INCLUDED_listener_h */ #endif /* INCLUDED_listener_h */

File diff suppressed because it is too large Load Diff

View File

@ -758,9 +758,9 @@ conf_set_listen_port(void *data)
} }
if(listener_address == NULL) if(listener_address == NULL)
{ {
add_listener(args->v.number, listener_address, AF_INET); add_listener(args->v.number, listener_address, AF_INET, 0);
#ifdef IPV6 #ifdef IPV6
add_listener(args->v.number, listener_address, AF_INET6); add_listener(args->v.number, listener_address, AF_INET6, 0);
#endif #endif
} }
else else
@ -773,7 +773,7 @@ conf_set_listen_port(void *data)
#endif #endif
family = AF_INET; family = AF_INET;
add_listener(args->v.number, listener_address, family); add_listener(args->v.number, listener_address, family, 0);
} }