Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mismatch between finished_handler_t and the actual handler function #112

Open
gammadean opened this issue Mar 19, 2016 · 0 comments
Open

Comments

@gammadean
Copy link

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.

log.do_configure.txt

log.do_compile.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant