Convert remaining boost::bind to std::bind in campaignd code
This commit is contained in:
parent
7def4d57eb
commit
b0fa8110f0
2 changed files with 11 additions and 12 deletions
|
@ -313,13 +313,13 @@ void server::handle_sighup(const boost::system::error_code&, int)
|
|||
|
||||
LOG_CS << "Reloaded configuration\n";
|
||||
|
||||
sighup_.async_wait(boost::bind(&server::handle_sighup, this, _1, _2));
|
||||
sighup_.async_wait(std::bind(&server::handle_sighup, this, _1, _2));
|
||||
}
|
||||
|
||||
void server::flush_cfg()
|
||||
{
|
||||
flush_timer_.expires_from_now(std::chrono::minutes(10));
|
||||
flush_timer_.async_wait(boost::bind(&server::handle_flush, this, _1));
|
||||
flush_timer_.async_wait(std::bind(&server::handle_flush, this, _1));
|
||||
}
|
||||
|
||||
void server::handle_flush(const boost::system::error_code& error)
|
||||
|
@ -408,7 +408,7 @@ void server::send_message(const std::string& msg, socket_ptr sock)
|
|||
{
|
||||
simple_wml::document doc;
|
||||
doc.root().add_child("message").set_attr_dup("message", msg.c_str());
|
||||
async_send_doc(sock, doc, boost::bind(&server::handle_new_client, this, _1), null_handler);
|
||||
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, _1), null_handler);
|
||||
}
|
||||
|
||||
void server::send_error(const std::string& msg, socket_ptr sock)
|
||||
|
@ -416,7 +416,7 @@ void server::send_error(const std::string& msg, socket_ptr sock)
|
|||
ERR_CS << "[" << client_address(sock) << "]: " << msg << '\n';
|
||||
simple_wml::document doc;
|
||||
doc.root().add_child("error").set_attr_dup("message", msg.c_str());
|
||||
async_send_doc(sock, doc, boost::bind(&server::handle_new_client, this, _1), null_handler);
|
||||
async_send_doc(sock, doc, std::bind(&server::handle_new_client, this, _1), null_handler);
|
||||
}
|
||||
|
||||
void server::register_handler(const std::string& cmd, const request_handler& func)
|
||||
|
@ -529,7 +529,7 @@ void server::handle_request_campaign_list(const server::request& req)
|
|||
simple_wml::document doc(wml.c_str(), simple_wml::INIT_STATIC);
|
||||
doc.compress();
|
||||
|
||||
async_send_doc(req.sock, doc, boost::bind(&server::handle_new_client, this, _1));
|
||||
async_send_doc(req.sock, doc, std::bind(&server::handle_new_client, this, _1));
|
||||
}
|
||||
|
||||
void server::handle_request_campaign(const server::request& req)
|
||||
|
@ -552,7 +552,7 @@ void server::handle_request_campaign(const server::request& req)
|
|||
|
||||
std::cerr << " size: " << size/1024 << "KiB\n";
|
||||
async_send_file(req.sock, campaign["filename"],
|
||||
boost::bind(&server::handle_new_client, this, _1), null_handler);
|
||||
std::bind(&server::handle_new_client, this, _1), null_handler);
|
||||
// Clients doing upgrades or some other specific thing shouldn't bump
|
||||
// the downloads count. Default to true for compatibility with old
|
||||
// clients that won't tell us what they are trying to do.
|
||||
|
|
|
@ -16,9 +16,8 @@
|
|||
|
||||
#include "log.hpp"
|
||||
#include "util.hpp"
|
||||
#include "utils/functional.hpp"
|
||||
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
|
||||
static lg::log_domain log_server("server");
|
||||
#define ERR_SERVER LOG_STREAM(err, log_server)
|
||||
|
@ -62,13 +61,13 @@ void server_base::start_server()
|
|||
[=](const boost::system::error_code& error, int sig)
|
||||
{ this->handle_sighup(error, sig); });
|
||||
#endif
|
||||
sigs_.async_wait(boost::bind(&server_base::handle_termination, this, _1, _2));
|
||||
sigs_.async_wait(std::bind(&server_base::handle_termination, this, _1, _2));
|
||||
}
|
||||
|
||||
void server_base::serve()
|
||||
{
|
||||
socket_ptr socket = std::make_shared<boost::asio::ip::tcp::socket>(boost::ref(io_service_));
|
||||
acceptor_.async_accept(*socket, boost::bind(&server_base::accept_connection, this, _1, socket));
|
||||
socket_ptr socket = std::make_shared<boost::asio::ip::tcp::socket>(std::ref(io_service_));
|
||||
acceptor_.async_accept(*socket, std::bind(&server_base::accept_connection, this, _1, socket));
|
||||
}
|
||||
|
||||
void server_base::accept_connection(const boost::system::error_code& error, socket_ptr socket)
|
||||
|
@ -104,7 +103,7 @@ void server_base::serverside_handshake(socket_ptr socket)
|
|||
boost::shared_array<char> handshake(new char[4]);
|
||||
async_read(
|
||||
*socket, boost::asio::buffer(handshake.get(), 4),
|
||||
boost::bind(&server_base::handle_handshake, this, _1, socket, handshake)
|
||||
std::bind(&server_base::handle_handshake, this, _1, socket, handshake)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue