Skip to content

fix(http2): proper start of server

Raphael Defosseux requested to merge fix-http2-server-start into develop
  • bump-up of nghttp2 --> see common-build MR
  • over-design on HTTP/2 server start procedure
    • server.join() was called twice ==> resulting in random but frequent seg faults
    • by starting in asynchronous mode, no need to run a thread in main

From asio_http2_server.h :

  // Starts listening connection on given address and port and serves
  // incoming requests in cleartext TCP connection.  If |asynchronous|
  // is false, this function blocks forever unless there is an error.
  // If it is true, after server has started, this function returns
  // immediately, and the caller should call stop() and join() to
  // shutdown server gracefully.
  boost::system::error_code listen_and_serve(boost::system::error_code &ec,
                                             const std::string &address,
                                             const std::string &port,
                                             bool asynchronous = false);
  • pthread_kill redundant. cancel is enough

Merge request reports