diff options
-rw-r--r-- | include/s_bsd.h | 3 | ||||
-rw-r--r-- | src/ircd.c | 2 | ||||
-rw-r--r-- | src/s_bsd.c | 25 |
3 files changed, 5 insertions, 25 deletions
diff --git a/include/s_bsd.h b/include/s_bsd.h index 47ee32b..e6326a3 100644 --- a/include/s_bsd.h +++ b/include/s_bsd.h @@ -39,8 +39,6 @@ struct Client; struct MaskItem; struct Listener; -extern struct Callback *setup_socket_cb; - extern void add_connection(struct Listener *, struct irc_ssaddr *, int); extern void close_connection(struct Client *); extern void report_error(int, const char *, const char *, int); @@ -61,7 +59,6 @@ extern int comm_accept(struct Listener *, struct irc_ssaddr *pn); /* These must be defined in the network IO loop code of your choice */ extern void init_netio(void); extern void comm_setselect(fde_t *, unsigned int, PF *, void *, time_t); -extern void init_comm(void); extern int read_message (time_t, unsigned char); extern void comm_select(void); extern void check_can_use_v6(void); @@ -531,7 +531,7 @@ main(int argc, char *argv[]) fdlist_init(); log_set_file(LOG_TYPE_IRCD, 0, logFileName); check_can_use_v6(); - init_comm(); /* This needs to be setup early ! -- adrian */ + init_netio(); /* This needs to be setup early ! -- adrian */ /* Check if there is pidfile and daemon already running */ check_pidfile(pidFileName); diff --git a/src/s_bsd.c b/src/s_bsd.c index 20bef26..89ba44d 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -52,8 +52,6 @@ static const char *comm_err_str[] = { "Comm OK", "Error during bind()", "Error during DNS lookup", "connect timeout", "Error during connect()", "Comm Error" }; -struct Callback *setup_socket_cb = NULL; - static void comm_connect_callback(fde_t *, int); static PF comm_connect_timeout; static void comm_connect_dns_callback(void *, const struct irc_ssaddr *, const char *); @@ -139,10 +137,9 @@ report_error(int level, const char* text, const char* who, int error) * * Set the socket non-blocking, and other wonderful bits. */ -static void * -setup_socket(va_list args) +static void +setup_socket(int fd) { - int fd = va_arg(args, int); int opt = 1; setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &opt, sizeof(opt)); @@ -153,20 +150,6 @@ setup_socket(va_list args) #endif fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK); - - return NULL; -} - -/* - * init_comm() - * - * Initializes comm subsystem. - */ -void -init_comm(void) -{ - setup_socket_cb = register_callback("setup_socket", setup_socket); - init_netio(); } /* @@ -712,7 +695,7 @@ comm_open(fde_t *F, int family, int sock_type, int proto, const char *note) if (fd < 0) return -1; /* errno will be passed through, yay.. */ - execute_callback(setup_socket_cb, fd); + setup_socket(fd); /* update things in our fd tracking */ fd_open(F, fd, 1, note); @@ -753,7 +736,7 @@ comm_accept(struct Listener *lptr, struct irc_ssaddr *pn) pn->ss_len = addrlen; #endif - execute_callback(setup_socket_cb, newfd); + setup_socket(newfd); /* .. and return */ return newfd; |