some code indentation, one more use of nullptr and constexpr

This commit is contained in:
Alden Torres 2017-10-14 16:52:07 -04:00 committed by Arvid Norberg
parent a6c85496b5
commit 8083a6c2bd
2 changed files with 7 additions and 7 deletions

View File

@ -70,7 +70,7 @@ namespace libtorrent {
struct http_connection; struct http_connection;
struct resolver_interface; 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<void(error_code const& typedef std::function<void(error_code const&
, http_parser const&, span<char const> data, http_connection&)> http_handler; , http_parser const&, span<char const> data, http_connection&)> http_handler;
@ -93,7 +93,7 @@ struct TORRENT_EXTRA_EXPORT http_connection
, http_connect_handler const& ch = http_connect_handler() , http_connect_handler const& ch = http_connect_handler()
, http_filter_handler const& fh = http_filter_handler() , http_filter_handler const& fh = http_filter_handler()
#ifdef TORRENT_USE_OPENSSL #ifdef TORRENT_USE_OPENSSL
, ssl::context* ssl_ctx = 0 , ssl::context* ssl_ctx = nullptr
#endif #endif
); );

View File

@ -346,7 +346,7 @@ void upnp::resend_request(error_code const& ec)
d.upnp_connection = std::make_shared<http_connection>(m_io_service d.upnp_connection = std::make_shared<http_connection>(m_io_service
, m_resolver , m_resolver
, std::bind(&upnp::on_upnp_xml, self(), _1, _2 , 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); d.upnp_connection->get(d.url, seconds(30), 1);
} }
TORRENT_CATCH (std::exception const& exc) TORRENT_CATCH (std::exception const& exc)
@ -690,7 +690,7 @@ void upnp::try_map_upnp(bool const timer)
d.upnp_connection = std::make_shared<http_connection>(m_io_service d.upnp_connection = std::make_shared<http_connection>(m_io_service
, m_resolver , m_resolver
, std::bind(&upnp::on_upnp_xml, self(), _1, _2 , 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); d.upnp_connection->get(d.url, seconds(30), 1);
} }
TORRENT_CATCH (std::exception const& exc) 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<http_connection>(m_io_service d.upnp_connection = std::make_shared<http_connection>(m_io_service
, m_resolver , m_resolver
, std::bind(&upnp::on_upnp_map_response, self(), _1, _2 , 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)); , 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
@ -852,7 +852,7 @@ void upnp::update_map(rootdevice& d, port_mapping_t const i)
d.upnp_connection = std::make_shared<http_connection>(m_io_service d.upnp_connection = std::make_shared<http_connection>(m_io_service
, m_resolver , m_resolver
, std::bind(&upnp::on_upnp_unmap_response, self(), _1, _2 , 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)); , 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, nullptr, false, 5, m.local_ep.address()); , 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<http_connection>(m_io_service d.upnp_connection = std::make_shared<http_connection>(m_io_service
, m_resolver , m_resolver
, std::bind(&upnp::on_upnp_get_ip_address_response, self(), _1, _2 , 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))); , std::bind(&upnp::get_ip_address, self(), std::ref(d)));
d.upnp_connection->start(d.hostname, d.port d.upnp_connection->start(d.hostname, d.port
, seconds(10), 1); , seconds(10), 1);