From 8ed17ab3110165d43272e5bc427d23bdd764c784 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Mon, 7 Aug 2017 13:48:39 -0400 Subject: [PATCH] minor code refactor, more use of nullptr, typos --- include/libtorrent/http_connection.hpp | 4 ++-- include/libtorrent/upnp.hpp | 4 ++-- src/upnp.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/libtorrent/http_connection.hpp b/include/libtorrent/http_connection.hpp index edc36f07f..89f55edcb 100644 --- a/include/libtorrent/http_connection.hpp +++ b/include/libtorrent/http_connection.hpp @@ -101,7 +101,7 @@ struct TORRENT_EXTRA_EXPORT http_connection std::string m_sendbuffer; 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() , boost::optional
const& bind_addr = boost::optional
() , 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 - , 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 , boost::optional
const& bind_addr = boost::optional
() , resolver_flags resolve_flags = resolver_flags{} diff --git a/include/libtorrent/upnp.hpp b/include/libtorrent/upnp.hpp index 5bc2f5e8d..f2c027f00 100644 --- a/include/libtorrent/upnp.hpp +++ b/include/libtorrent/upnp.hpp @@ -79,7 +79,7 @@ namespace libtorrent { // lease times on port mappings only_permanent_leases_supported = 725, // 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, // ExternalPort must be a wildcard and cannot be a // specific port @@ -358,7 +358,7 @@ private: deadline_timer m_refresh_timer; // 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 // response from a router UPnP device, we override the ignoring behavior and // map them anyway. diff --git a/src/upnp.cpp b/src/upnp.cpp index 27cd45176..9a401d08d 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -630,7 +630,7 @@ void upnp::try_map_upnp(bool const timer) // should try to map with the ones we did hear from anyway, // regardless of if they are not running at our gateway. 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 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)); 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) { @@ -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::bind(&upnp::delete_port_mapping, self(), std::ref(d), i)); 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;