Visitar URL original
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<std::__exception_ptr::exception_ptr>' · Issue #872 · cpp-netlib/cpp-netlib · GitHub
Skip to content

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

Description

@kealennieh

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 !

Activity

  1. igorpeshansky commented on May 10, 2019

    @igorpeshansky

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions