X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_socket.c;fp=src%2Fnet_socket.c;h=2a47a72f436bcaefe4921f050f8b6b24fc2b1e58;hb=084ba04f51441098c55d3bd21b11bbe368e7b52e;hp=072984bfaab51abb8d1d46a7f6773a5ce05924b6;hpb=7139dc96be39abcdcf7f20e134a5e9b8abce05c4;p=meshlink diff --git a/src/net_socket.c b/src/net_socket.c index 072984bf..2a47a72f 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -24,7 +24,6 @@ #include "conf.h" #include "connection.h" -#include "control_common.h" #include "list.h" #include "logger.h" #include "meta.h" @@ -49,9 +48,6 @@ int max_connection_burst = 100; listen_socket_t listen_socket[MAXSOCKETS]; int listen_sockets; -#ifndef HAVE_MINGW -io_t unix_socket; -#endif list_t *outgoing_list = NULL; /* Setup sockets */ @@ -703,45 +699,6 @@ void handle_new_meta_connection(void *data, int flags) { send_id(c); } -#ifndef HAVE_MINGW -/* - accept a new UNIX socket connection -*/ -void handle_new_unix_connection(void *data, int flags) { - io_t *io = data; - connection_t *c; - sockaddr_t sa; - int fd; - socklen_t len = sizeof sa; - - fd = accept(io->fd, &sa.sa, &len); - - if(fd < 0) { - logger(DEBUG_ALWAYS, LOG_ERR, "Accepting a new connection failed: %s", sockstrerror(sockerrno)); - return; - } - - sockaddrunmap(&sa); - - c = new_connection(); - c->name = xstrdup(""); - c->address = sa; - c->hostname = xstrdup("localhost port unix"); - c->socket = fd; - c->last_ping_time = now.tv_sec; - - logger(DEBUG_CONNECTIONS, LOG_NOTICE, "Connection from %s", c->hostname); - - io_add(&c->io, handle_meta_io, c, c->socket, IO_READ); - - connection_add(c); - - c->allow_request = ID; - - send_id(c); -} -#endif - static void free_outgoing(outgoing_t *outgoing) { timeout_del(&outgoing->ev);