Skip to content
Snippets Groups Projects
Commit 7ba53cb4 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

proxy client: use unique_ptr for timers

parent fbff8389
Branches
Tags
No related merge requests found
...@@ -378,8 +378,8 @@ private: ...@@ -378,8 +378,8 @@ private:
* Retrieve if we can connect to the proxy (update statusIpvX_) * Retrieve if we can connect to the proxy (update statusIpvX_)
*/ */
void handleProxyConfirm(const asio::error_code &ec); void handleProxyConfirm(const asio::error_code &ec);
Sp<asio::steady_timer> nextProxyConfirmationTimer_; std::unique_ptr<asio::steady_timer> nextProxyConfirmationTimer_;
Sp<asio::steady_timer> listenerRestartTimer_; std::unique_ptr<asio::steady_timer> listenerRestartTimer_;
/** /**
* Relaunch LISTEN requests if the client disconnect/reconnect. * Relaunch LISTEN requests if the client disconnect/reconnect.
......
...@@ -155,10 +155,10 @@ DhtProxyClient::startProxy() ...@@ -155,10 +155,10 @@ DhtProxyClient::startProxy()
if (logger_) if (logger_)
logger_->d("[proxy:client] start proxy with %s", proxyUrl_.c_str()); logger_->d("[proxy:client] start proxy with %s", proxyUrl_.c_str());
nextProxyConfirmationTimer_ = std::make_shared<asio::steady_timer>(httpContext_, std::chrono::steady_clock::now()); nextProxyConfirmationTimer_ = std::make_unique<asio::steady_timer>(httpContext_, std::chrono::steady_clock::now());
nextProxyConfirmationTimer_->async_wait(std::bind(&DhtProxyClient::handleProxyConfirm, this, std::placeholders::_1)); nextProxyConfirmationTimer_->async_wait(std::bind(&DhtProxyClient::handleProxyConfirm, this, std::placeholders::_1));
listenerRestartTimer_ = std::make_shared<asio::steady_timer>(httpContext_); listenerRestartTimer_ = std::make_unique<asio::steady_timer>(httpContext_);
loopSignal_(); loopSignal_();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment