X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fnet_socket.c;fp=src%2Fnet_socket.c;h=b8ed76d83a5a4e6a3928bed85c7f63e767265898;hb=1c1ea3e501944f1e49cb65add689d9cd6dea8af6;hp=072984bfaab51abb8d1d46a7f6773a5ce05924b6;hpb=7f7b53dc2011fc8ceda1e0678d9f78b1dbd8c1d1;p=meshlink diff --git a/src/net_socket.c b/src/net_socket.c index 072984bf..b8ed76d8 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -24,11 +24,9 @@ #include "conf.h" #include "connection.h" -#include "control_common.h" #include "list.h" #include "logger.h" #include "meta.h" -#include "names.h" #include "net.h" #include "netutl.h" #include "protocol.h" @@ -49,9 +47,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 */ @@ -362,8 +357,6 @@ static void do_outgoing_pipe(connection_t *c, char *command) { setenv("REMOTEPORT", port, true); setenv("NODE", c->name, true); setenv("NAME", myself->name, true); - if(netname) - setenv("NETNAME", netname, true); int result = system(command); if(result < 0) @@ -703,45 +696,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);