X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=config.cpp;h=091796151f811a241a929adde38b90afad8336bf;hb=3ee5393cf900382d7aa2939694ac0fedb30928c2;hp=57bf10a7f0ddc038f892a4e08b62706341d98842;hpb=b08dc2a81825a298a03f2dee2ae7dd7045e72739;p=cubemap diff --git a/config.cpp b/config.cpp index 57bf10a..0917961 100644 --- a/config.cpp +++ b/config.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include #include #include @@ -18,7 +19,7 @@ using namespace std; -#define DEFAULT_BACKLOG_SIZE 1048576 +#define DEFAULT_BACKLOG_SIZE 10485760 struct ConfigLine { string keyword; @@ -187,7 +188,7 @@ bool parse_port(const ConfigLine &line, Config *config) } AcceptorConfig acceptor; - acceptor.addr = CreateAnyAddress(port); + acceptor.addr = create_any_address(port); config->acceptors.push_back(acceptor); return true; @@ -298,6 +299,18 @@ bool parse_udpstream(const ConfigLine &line, Config *config) udpstream.ttl = atoi(ttl_it->second.c_str()); } + // Parse the multicast interface index. + map::const_iterator multicast_iface_it = line.parameters.find("multicast_output_interface"); + if (multicast_iface_it == line.parameters.end()) { + udpstream.multicast_iface_index = -1; + } else { + udpstream.multicast_iface_index = if_nametoindex(multicast_iface_it->second.c_str()); + if (udpstream.multicast_iface_index == 0) { + log(ERROR, "Interface '%s' does not exist", multicast_iface_it->second.c_str()); + return false; + } + } + config->udpstreams.push_back(udpstream); return true; }