From 8083a6c2bd52e688c2a99559382eca4b989a9b24 Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Sat, 14 Oct 2017 16:52:07 -0400 Subject: [PATCH] some code indentation, one more use of nullptr and constexpr --- include/libtorrent/http_connection.hpp | 4 ++-- src/upnp.cpp | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/libtorrent/http_connection.hpp b/include/libtorrent/http_connection.hpp index b03035e26..49e3aea3d 100644 --- a/include/libtorrent/http_connection.hpp +++ b/include/libtorrent/http_connection.hpp @@ -70,7 +70,7 @@ namespace libtorrent { struct http_connection; struct resolver_interface; -const int default_max_bottled_buffer_size = 2 * 1024 * 1024; +constexpr int default_max_bottled_buffer_size = 2 * 1024 * 1024; typedef std::function data, http_connection&)> http_handler; @@ -93,7 +93,7 @@ struct TORRENT_EXTRA_EXPORT http_connection , http_connect_handler const& ch = http_connect_handler() , http_filter_handler const& fh = http_filter_handler() #ifdef TORRENT_USE_OPENSSL - , ssl::context* ssl_ctx = 0 + , ssl::context* ssl_ctx = nullptr #endif ); diff --git a/src/upnp.cpp b/src/upnp.cpp index 3ef5b7e32..75657190e 100644 --- a/src/upnp.cpp +++ b/src/upnp.cpp @@ -346,7 +346,7 @@ void upnp::resend_request(error_code const& ec) d.upnp_connection = std::make_shared(m_io_service , m_resolver , std::bind(&upnp::on_upnp_xml, self(), _1, _2 - , std::ref(d), _4)); + , std::ref(d), _4)); d.upnp_connection->get(d.url, seconds(30), 1); } TORRENT_CATCH (std::exception const& exc) @@ -690,7 +690,7 @@ void upnp::try_map_upnp(bool const timer) d.upnp_connection = std::make_shared(m_io_service , m_resolver , std::bind(&upnp::on_upnp_xml, self(), _1, _2 - , std::ref(d), _4)); + , std::ref(d), _4)); d.upnp_connection->get(d.url, seconds(30), 1); } TORRENT_CATCH (std::exception const& exc) @@ -840,7 +840,7 @@ void upnp::update_map(rootdevice& d, port_mapping_t const i) d.upnp_connection = std::make_shared(m_io_service , m_resolver , std::bind(&upnp::on_upnp_map_response, self(), _1, _2 - , std::ref(d), i, _4), true, default_max_bottled_buffer_size + , std::ref(d), i, _4), true, default_max_bottled_buffer_size , std::bind(&upnp::create_port_mapping, self(), _1, std::ref(d), i)); d.upnp_connection->start(d.hostname, d.port @@ -852,7 +852,7 @@ void upnp::update_map(rootdevice& d, port_mapping_t const i) d.upnp_connection = std::make_shared(m_io_service , m_resolver , std::bind(&upnp::on_upnp_unmap_response, self(), _1, _2 - , std::ref(d), i, _4), true, default_max_bottled_buffer_size + , std::ref(d), i, _4), 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, nullptr, false, 5, m.local_ep.address()); @@ -1062,7 +1062,7 @@ void upnp::on_upnp_xml(error_code const& e d.upnp_connection = std::make_shared(m_io_service , m_resolver , std::bind(&upnp::on_upnp_get_ip_address_response, self(), _1, _2 - , std::ref(d), _4), true, default_max_bottled_buffer_size + , std::ref(d), _4), true, default_max_bottled_buffer_size , std::bind(&upnp::get_ip_address, self(), std::ref(d))); d.upnp_connection->start(d.hostname, d.port , seconds(10), 1);