]> git.sesse.net Git - cubemap/blobdiff - config.cpp
Support configurable BACKLOG_SIZE (per-stream). No support for changing across restar...
[cubemap] / config.cpp
index 489711363482149c5b0f8d89621dc2c294c2b81a..32e0e654164142d6dcd6f8dffc419fffc35483dc 100644 (file)
@@ -13,6 +13,8 @@
 
 using namespace std;
 
+#define DEFAULT_BACKLOG_SIZE 1048576
+
 struct ConfigLine {
        string keyword;
        vector<string> arguments;
@@ -197,6 +199,13 @@ bool parse_stream(const ConfigLine &line, Config *config)
                // TODO: Verify that the URL is parseable?
        }
 
+       map<string, string>::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<string, string>::const_iterator mark_parm_it = line.parameters.find("mark");
        if (mark_parm_it == line.parameters.end()) {