-
Notifications
You must be signed in to change notification settings - Fork 94
Description
I'm trying to build using CMake with gcc 5.2 and Boost 1.58 and having a problem where the type definition for the handler doesn't match the actual function implementation and that causes a compiler error.
Specifically, http_server.cpp implements:
void server::handle_request(http::request_ptr& http_request_ptr, tcp::connection_ptr& tcp_conn, const boost::system::error_code& ec)
and binds it to a finished handler using:
my_reader_ptr = request_reader::create(tcp_conn, boost::bind(&server::handle_request, this, _1, _2, _3));
However, request_reader.hpp defines the finished_handler_t as:
typedef boost::function3<void, http::request_ptr, tcp::connection_ptr, const boost::system::error_code&> finished_handler_t;
Notice that server::handle_request has the 2nd and 3rd parameters defined as references but finished_handler_t does not. I can get rid of the error by modifying finished_handler_t to use references but I'm a lowly C programmer so I don't know if that's the correct solution. To further my doubt, the same problem is in tcp_server.cpp but the fix does not work there since the handler is eventually called using shared_from_this() and that causes an entirely different problem.