From 96c60d39ed8f33eeb29fd6ea169a1df184c2cdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= Date: Tue, 12 Jun 2018 18:12:11 -0400 Subject: [PATCH] proxy server: reschedule after using function --- src/dht_proxy_server.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dht_proxy_server.cpp b/src/dht_proxy_server.cpp index 3b8a199e..6506a40e 100644 --- a/src/dht_proxy_server.cpp +++ b/src/dht_proxy_server.cpp @@ -138,13 +138,13 @@ DhtProxyServer::DhtProxyServer(std::shared_ptr dht, in_port_t port , if (stopListeners) return; if (service_->is_up()) std::cout << getStats().toString() << std::endl; - scheduler_.edit(printStatsJob_, scheduler_.time() + PRINT_STATS_PERIOD); // Refresh stats cache auto newInfo = dht_->getNodeInfo(); { std::lock_guard lck(statsMutex_); nodeInfo_ = std::move(newInfo); } + scheduler_.edit(printStatsJob_, scheduler_.time() + PRINT_STATS_PERIOD); }); } @@ -202,7 +202,7 @@ DhtProxyServer::getNodeInfo(const std::shared_ptr& session) co const auto request = session->get_request(); int content_length = std::stoi(request->get_header("Content-Length", "0")); session->fetch(content_length, - [=](const std::shared_ptr s, const restbed::Bytes& /*b*/) + [this](const std::shared_ptr s, const restbed::Bytes& /*b*/) mutable { try { if (dht_) {