Fix default ping_timeout config value

This commit is contained in:
loki 2020-03-01 14:06:47 +01:00
parent 1d6c6046a2
commit 1362abc70d
2 changed files with 6 additions and 5 deletions

View File

@ -188,7 +188,9 @@ void parse_file(const char *file) {
int_between_f(vars, "ping_timeout", to, {
-1, std::numeric_limits<int>::max()
});
if(to == -1) {
stream.ping_timeout = std::chrono::milliseconds(to);
}
int_between_f(vars, "channels", stream.channels, {
1, std::numeric_limits<int>::max()

View File

@ -262,10 +262,9 @@ void control_server_t::iterate(std::chrono::milliseconds timeout) {
{
net::packet_t packet { event.packet };
std::uint16_t *type = (std::uint16_t *)packet->data;
auto type = (std::uint16_t *)packet->data;
std::string_view payload { (char*)packet->data + sizeof(*type), packet->dataLength - sizeof(*type) };
auto cb = _map_type_cb.find(*type);
if(cb == std::end(_map_type_cb)) {
BOOST_LOG(warning)
@ -424,7 +423,7 @@ void controlBroadcastThread(safe::signal_t *shutdown_event, control_server_t *se
});
server->map(packetTypes[IDX_INVALIDATE_REF_FRAMES], [&](session_t *session, const std::string_view &payload) {
std::int64_t *frames = (std::int64_t *)payload.data();
auto frames = (std::int64_t *)payload.data();
auto firstFrame = frames[0];
auto lastFrame = frames[1];