mirror of
https://github.com/XRPLF/clio.git
synced 2026-04-29 15:37:53 +00:00
fix: Fix bugs in new webserver (#1780)
Fixes #919. Fixes bugs for new webserver: - Unhandled exception when closing already closed websocket - No pings for plain websocket connection - Server drops websocket connection when client responds to pings but doesn't send anything Also changing API of ng connections. Now timeout is set by a separate method instead of providing it for each call.
This commit is contained in:
@@ -32,6 +32,7 @@
|
||||
#include <boost/asio/ssl/verify_mode.hpp>
|
||||
#include <boost/beast/core/buffers_to_string.hpp>
|
||||
#include <boost/beast/core/flat_buffer.hpp>
|
||||
#include <boost/beast/core/role.hpp>
|
||||
#include <boost/beast/core/stream_traits.hpp>
|
||||
#include <boost/beast/http/field.hpp>
|
||||
#include <boost/beast/version.hpp>
|
||||
@@ -150,8 +151,8 @@ WebSocketAsyncClient::connect(
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
boost::beast::websocket::stream_base::timeout wsTimeout{};
|
||||
stream_.get_option(wsTimeout);
|
||||
boost::beast::websocket::stream_base::timeout wsTimeout =
|
||||
boost::beast::websocket::stream_base::timeout::suggested(boost::beast::role_type::client);
|
||||
wsTimeout.handshake_timeout = timeout;
|
||||
stream_.set_option(wsTimeout);
|
||||
boost::beast::get_lowest_layer(stream_).expires_never();
|
||||
|
||||
Reference in New Issue
Block a user