add const

This commit is contained in:
pavel.pimenov 2017-09-29 19:08:26 +03:00 committed by Arvid Norberg
parent 7444c12c6c
commit f3796060d3
5 changed files with 11 additions and 12 deletions

View File

@ -279,10 +279,10 @@ namespace libtorrent {
// temporarily unavailable, retry later
t->retry_web_seed(this, retry_time);
std::string error_msg = to_string(m_parser.status_code()).data()
+ (" " + m_parser.message());
if (t->alerts().should_post<url_seed_alert>())
{
std::string const error_msg = to_string(m_parser.status_code()).data()
+ (" " + m_parser.message());
t->alerts().emplace_alert<url_seed_alert>(t->get_handle(), url()
, error_msg);
}

View File

@ -112,7 +112,7 @@ namespace libtorrent {
if (found_end)
{
m_buffer.push_back(0);
char* status = std::strchr(m_buffer.data(), ' ');
char const* status = std::strchr(m_buffer.data(), ' ');
if (status == nullptr)
{
h(boost::asio::error::operation_not_supported);
@ -122,7 +122,7 @@ namespace libtorrent {
}
status++;
int code = std::atoi(status);
int const code = std::atoi(status);
if (code != 200)
{
h(boost::asio::error::operation_not_supported);

View File

@ -270,7 +270,7 @@ void node::incoming(aux::listen_socket_handle const& s, msg const& m)
return;
}
char y = *(y_ent.string_ptr());
const char y = *(y_ent.string_ptr());
bdecode_node ext_ip = m.message.dict_find_string("ip");

View File

@ -5810,13 +5810,12 @@ namespace {
void on_dht_put_mutable_item(alert_manager& alerts, dht::item const& i, int num)
{
dht::signature sig = i.sig();
dht::public_key pk = i.pk();
dht::sequence_number seq = i.seq();
std::string salt = i.salt();
if (alerts.should_post<dht_put_alert>())
{
dht::signature const sig = i.sig();
dht::public_key const pk = i.pk();
dht::sequence_number const seq = i.seq();
std::string const salt = i.salt();
alerts.emplace_alert<dht_put_alert>(pk.bytes, sig.bytes, salt
, seq.value, num);
}

View File

@ -582,10 +582,10 @@ void web_peer_connection::handle_error(int const bytes_left)
if (retry_time <= 0) retry_time = m_settings.get_int(settings_pack::urlseed_wait_retry);
// temporarily unavailable, retry later
t->retry_web_seed(this, retry_time);
std::string error_msg = to_string(m_parser.status_code()).data()
+ (" " + m_parser.message());
if (t->alerts().should_post<url_seed_alert>())
{
std::string const error_msg = to_string(m_parser.status_code()).data()
+ (" " + m_parser.message());
t->alerts().emplace_alert<url_seed_alert>(t->get_handle(), m_url
, error_msg);
}