X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=config.cpp;h=57bf10a7f0ddc038f892a4e08b62706341d98842;hb=b08dc2a81825a298a03f2dee2ae7dd7045e72739;hp=4a3dfb3122a7061a65fb49d2ffbfcc36c3d9037d;hpb=5cc8cd703a637e276c2595953878fd9561592bfa;p=cubemap diff --git a/config.cpp b/config.cpp index 4a3dfb3..57bf10a 100644 --- a/config.cpp +++ b/config.cpp @@ -132,7 +132,10 @@ bool read_config(const string &filename, vector *lines) lines->push_back(line); } - fclose(fp); + if (fclose(fp) == EOF) { + log_perror(filename.c_str()); + return false; + } return true; } @@ -287,6 +290,14 @@ bool parse_udpstream(const ConfigLine &line, Config *config) udpstream.pacing_rate = atoi(pacing_rate_it->second.c_str()) * 1024 / 8; } + // Parse the TTL. The same value is used for unicast and multicast. + map::const_iterator ttl_it = line.parameters.find("ttl"); + if (ttl_it == line.parameters.end()) { + udpstream.ttl = -1; + } else { + udpstream.ttl = atoi(ttl_it->second.c_str()); + } + config->udpstreams.push_back(udpstream); return true; }