+#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sys/socket.h>
#include <map>
#include <string>
#include <utility>
stream.mark_pool = allocate_mark_pool(from, to, config);
}
+ // Parse the pacing rate, converting from kilobits to bytes as needed.
+ map<string, string>::const_iterator pacing_rate_it = line.parameters.find("pacing_rate_kbit");
+ if (pacing_rate_it == line.parameters.end()) {
+ stream.pacing_rate = ~0U;
+ } else {
+ stream.pacing_rate = atoi(pacing_rate_it->second.c_str()) * 1024 / 8;
+ }
+
config->streams.push_back(stream);
return true;
}
udpstream.mark_pool = allocate_mark_pool(from, to, config);
}
+ // Parse the pacing rate, converting from kilobits to bytes as needed.
+ map<string, string>::const_iterator pacing_rate_it = line.parameters.find("pacing_rate_kbit");
+ if (pacing_rate_it == line.parameters.end()) {
+ udpstream.pacing_rate = ~0U;
+ } else {
+ udpstream.pacing_rate = atoi(pacing_rate_it->second.c_str()) * 1024 / 8;
+ }
+
config->udpstreams.push_back(udpstream);
return true;
}
+
bool parse_error_log(const ConfigLine &line, Config *config)
{
if (line.arguments.size() != 0) {
bool has_stats_file = fetch_config_string(lines, "stats_file", &config->stats_file);
bool has_stats_interval = fetch_config_int(lines, "stats_interval", &config->stats_interval);
if (has_stats_interval && !has_stats_file) {
- log(WARNING, "'stats_interval' given, but no 'stats_file'. No statistics will be written.");
+ log(WARNING, "'stats_interval' given, but no 'stats_file'. No client statistics will be written.");
+ }
+
+ config->input_stats_interval = 60;
+ bool has_input_stats_file = fetch_config_string(lines, "input_stats_file", &config->input_stats_file);
+ bool has_input_stats_interval = fetch_config_int(lines, "input_stats_interval", &config->input_stats_interval);
+ if (has_input_stats_interval && !has_input_stats_file) {
+ log(WARNING, "'input_stats_interval' given, but no 'input_stats_file'. No input statistics will be written.");
}
fetch_config_string(lines, "access_log", &config->access_log_file);
if (line.keyword == "num_servers" ||
line.keyword == "stats_file" ||
line.keyword == "stats_interval" ||
+ line.keyword == "input_stats_file" ||
+ line.keyword == "input_stats_interval" ||
line.keyword == "access_log") {
// Already taken care of, above.
} else if (line.keyword == "port") {