X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=config.cpp;h=bcd86a9c2cb0101aeea3f4cc1141c6d902b8e5d4;hp=489711363482149c5b0f8d89621dc2c294c2b81a;hb=93bcb482a3f433504aa794441ea4a69aede345ff;hpb=2c6cd9718a5baf5a2ed5be73ec3c525d4873f45a diff --git a/config.cpp b/config.cpp index 4897113..bcd86a9 100644 --- a/config.cpp +++ b/config.cpp @@ -1,18 +1,20 @@ +#include +#include #include -#include #include -#include -#include -#include +#include #include -#include #include +#include +#include #include "config.h" #include "parse.h" using namespace std; +#define DEFAULT_BACKLOG_SIZE 1048576 + struct ConfigLine { string keyword; vector arguments; @@ -197,6 +199,13 @@ bool parse_stream(const ConfigLine &line, Config *config) // TODO: Verify that the URL is parseable? } + map::const_iterator backlog_it = line.parameters.find("backlog_size"); + if (backlog_it == line.parameters.end()) { + stream.backlog_size = DEFAULT_BACKLOG_SIZE; + } else { + stream.backlog_size = atoi(backlog_it->second.c_str()); + } + // Parse marks, if so desired. map::const_iterator mark_parm_it = line.parameters.find("mark"); if (mark_parm_it == line.parameters.end()) {