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

upnp: set context in ConnectionManager

Change-Id: I2fe4f7e2c48edb99154d07619a79dae3bff6b091
parent 3bd61c98
Branches
Tags
No related merge requests found
...@@ -31,7 +31,7 @@ namespace upnp { ...@@ -31,7 +31,7 @@ namespace upnp {
class UPnPContext; class UPnPContext;
class Controller class Controller : std::enable_shared_from_this<Controller>
{ {
public: public:
Controller(const std::shared_ptr<UPnPContext>& ctx); Controller(const std::shared_ptr<UPnPContext>& ctx);
......
...@@ -1473,6 +1473,7 @@ ConnectionManager::Impl::getIceOptions() const noexcept ...@@ -1473,6 +1473,7 @@ ConnectionManager::Impl::getIceOptions() const noexcept
IceTransportOptions opts; IceTransportOptions opts;
opts.factory = config_->factory; opts.factory = config_->factory;
opts.upnpEnable = getUPnPActive(); opts.upnpEnable = getUPnPActive();
opts.upnpContext = config_->upnpCtrl;
if (config_->stunEnabled) if (config_->stunEnabled)
opts.stunServers.emplace_back(StunServerInfo().setUri(config_->stunServer)); opts.stunServers.emplace_back(StunServerInfo().setUri(config_->stunServer));
......
...@@ -415,7 +415,7 @@ IceTransport::Impl::initIceInstance(const IceTransportOptions& options) ...@@ -415,7 +415,7 @@ IceTransport::Impl::initIceInstance(const IceTransportOptions& options)
initiatorSession_ ? "master" : "slave"); initiatorSession_ ? "master" : "slave");
if (upnpEnabled_) if (upnpEnabled_)
upnp_.reset(new upnp::Controller(options.upnpContext)); upnp_ = std::make_shared<upnp::Controller>(options.upnpContext);
config_ = options.factory->getIceCfg(); // config copy config_ = options.factory->getIceCfg(); // config copy
if (isTcp_) { if (isTcp_) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment