minor code refactor, more use of nullptr, typos
This commit is contained in:
parent
0b83b6b6df
commit
8ed17ab311
|
@ -101,7 +101,7 @@ struct TORRENT_EXTRA_EXPORT http_connection
|
||||||
std::string m_sendbuffer;
|
std::string m_sendbuffer;
|
||||||
|
|
||||||
void get(std::string const& url, time_duration timeout = seconds(30)
|
void get(std::string const& url, time_duration timeout = seconds(30)
|
||||||
, int prio = 0, aux::proxy_settings const* ps = NULL, int handle_redirects = 5
|
, int prio = 0, aux::proxy_settings const* ps = nullptr, int handle_redirects = 5
|
||||||
, std::string const& user_agent = std::string()
|
, std::string const& user_agent = std::string()
|
||||||
, boost::optional<address> const& bind_addr = boost::optional<address>()
|
, boost::optional<address> const& bind_addr = boost::optional<address>()
|
||||||
, resolver_flags resolve_flags = resolver_flags{}, std::string const& auth_ = std::string()
|
, resolver_flags resolve_flags = resolver_flags{}, std::string const& auth_ = std::string()
|
||||||
|
@ -111,7 +111,7 @@ struct TORRENT_EXTRA_EXPORT http_connection
|
||||||
);
|
);
|
||||||
|
|
||||||
void start(std::string const& hostname, int port
|
void start(std::string const& hostname, int port
|
||||||
, time_duration timeout, int prio = 0, aux::proxy_settings const* ps = NULL
|
, time_duration timeout, int prio = 0, aux::proxy_settings const* ps = nullptr
|
||||||
, bool ssl = false, int handle_redirect = 5
|
, bool ssl = false, int handle_redirect = 5
|
||||||
, boost::optional<address> const& bind_addr = boost::optional<address>()
|
, boost::optional<address> const& bind_addr = boost::optional<address>()
|
||||||
, resolver_flags resolve_flags = resolver_flags{}
|
, resolver_flags resolve_flags = resolver_flags{}
|
||||||
|
|
|
@ -79,7 +79,7 @@ namespace libtorrent {
|
||||||
// lease times on port mappings
|
// lease times on port mappings
|
||||||
only_permanent_leases_supported = 725,
|
only_permanent_leases_supported = 725,
|
||||||
// RemoteHost must be a wildcard and cannot be a
|
// RemoteHost must be a wildcard and cannot be a
|
||||||
// specific IP addres or DNS name
|
// specific IP address or DNS name
|
||||||
remote_host_must_be_wildcard = 726,
|
remote_host_must_be_wildcard = 726,
|
||||||
// ExternalPort must be a wildcard and cannot be a
|
// ExternalPort must be a wildcard and cannot be a
|
||||||
// specific port
|
// specific port
|
||||||
|
@ -358,7 +358,7 @@ private:
|
||||||
deadline_timer m_refresh_timer;
|
deadline_timer m_refresh_timer;
|
||||||
|
|
||||||
// this timer fires one second after the last UPnP response. This is the
|
// this timer fires one second after the last UPnP response. This is the
|
||||||
// point where we assume we have received most or all SSDP reponses. If we
|
// point where we assume we have received most or all SSDP responses. If we
|
||||||
// are ignoring non-routers and at this point we still haven't received a
|
// are ignoring non-routers and at this point we still haven't received a
|
||||||
// response from a router UPnP device, we override the ignoring behavior and
|
// response from a router UPnP device, we override the ignoring behavior and
|
||||||
// map them anyway.
|
// map them anyway.
|
||||||
|
|
|
@ -630,7 +630,7 @@ void upnp::try_map_upnp(bool const timer)
|
||||||
// should try to map with the ones we did hear from anyway,
|
// should try to map with the ones we did hear from anyway,
|
||||||
// regardless of if they are not running at our gateway.
|
// regardless of if they are not running at our gateway.
|
||||||
override_ignore_non_routers = std::none_of(m_devices.begin()
|
override_ignore_non_routers = std::none_of(m_devices.begin()
|
||||||
, m_devices.end(), [](rootdevice const& d) { return d.non_router == false; });
|
, m_devices.end(), [](rootdevice const& d) { return !d.non_router; });
|
||||||
#ifndef TORRENT_DISABLE_LOGGING
|
#ifndef TORRENT_DISABLE_LOGGING
|
||||||
if (override_ignore_non_routers)
|
if (override_ignore_non_routers)
|
||||||
{
|
{
|
||||||
|
@ -818,7 +818,7 @@ void upnp::update_map(rootdevice& d, int const i)
|
||||||
, std::bind(&upnp::create_port_mapping, self(), _1, std::ref(d), i));
|
, std::bind(&upnp::create_port_mapping, self(), _1, std::ref(d), i));
|
||||||
|
|
||||||
d.upnp_connection->start(d.hostname, d.port
|
d.upnp_connection->start(d.hostname, d.port
|
||||||
, seconds(10), 1, NULL, false, 5, m.local_ep.address());
|
, seconds(10), 1, nullptr, false, 5, m.local_ep.address());
|
||||||
}
|
}
|
||||||
else if (m.act == portmap_action::del)
|
else if (m.act == portmap_action::del)
|
||||||
{
|
{
|
||||||
|
@ -829,7 +829,7 @@ void upnp::update_map(rootdevice& d, int const i)
|
||||||
, std::ref(d), i, _5), true, default_max_bottled_buffer_size
|
, std::ref(d), i, _5), true, default_max_bottled_buffer_size
|
||||||
, std::bind(&upnp::delete_port_mapping, self(), std::ref(d), i));
|
, std::bind(&upnp::delete_port_mapping, self(), std::ref(d), i));
|
||||||
d.upnp_connection->start(d.hostname, d.port
|
d.upnp_connection->start(d.hostname, d.port
|
||||||
, seconds(10), 1, NULL, false, 5, m.local_ep.address());
|
, seconds(10), 1, nullptr, false, 5, m.local_ep.address());
|
||||||
}
|
}
|
||||||
|
|
||||||
m.act = portmap_action::none;
|
m.act = portmap_action::none;
|
||||||
|
|
Loading…
Reference in New Issue