diff --git a/src/asio_server_http2.cc b/src/asio_server_http2.cc index f00d77cd..e33b38ef 100644 --- a/src/asio_server_http2.cc +++ b/src/asio_server_http2.cc @@ -40,6 +40,18 @@ http2::http2() : impl_(make_unique()) {} http2::~http2() {} +http2::http2(http2 &&other) : impl_(std::move(other.impl_)) {} + +http2 &http2::operator=(http2 &&other) { + if (this == &other) { + return *this; + } + + impl_ = std::move(other.impl_); + + return *this; +} + boost::system::error_code http2::listen_and_serve(boost::system::error_code &ec, const std::string &address, const std::string &port) { diff --git a/src/includes/nghttp2/asio_http2_server.h b/src/includes/nghttp2/asio_http2_server.h index 21c662c5..c43408cc 100644 --- a/src/includes/nghttp2/asio_http2_server.h +++ b/src/includes/nghttp2/asio_http2_server.h @@ -126,6 +126,9 @@ public: http2(); ~http2(); + http2(http2 &&other); + http2 &operator=(http2 &&other); + // Starts listening connection on given address and port and serves // incoming requests in cleartext TCP connection. boost::system::error_code listen_and_serve(boost::system::error_code &ec,