The Wayback Machine - https://web.archive.org/web/20210112002842/https://github.com/cpp-netlib/cpp-netlib/issues/872
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

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<std::__exception_ptr::exception_ptr>' #872

Open
kealennieh opened this issue May 10, 2019 · 1 comment

Comments

@kealennieh
Copy link

@kealennieh kealennieh commented May 10, 2019

I try hello_world_server.cpp example. After I start the program and send the request, I've got the following problem.

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<std::__exception_ptr::exception_ptr>'

I find the problem just in the following code.

struct hello_world {
  /*<< This is the function that handles the incoming request. >>*/
  void operator()(server::request const &request, server::connection_ptr response) {
    server::string_type ip = source(request);
    unsigned int port = request.source_port;
    std::ostringstream data;
    
    data << "Hello, " << ip << ':' << port << '!';
    response->write(data.str());     // where the problem occurs !!!!!
  }
};

Any solutions ? Many thanks !

@igorpeshansky
Copy link

@igorpeshansky igorpeshansky commented May 10, 2019

See also #776. I have had a PR in-progress to fix this (#841), but never managed to get back to it. See if patching it in fixes your problem.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.