mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-02 16:26:48 +00:00
Updates on_http and validate handlers to use new handler interface
This commit is contained in:
@@ -762,7 +762,9 @@ bool connection<config>::process_handshake_request() {
|
||||
// this is not a websocket handshake. Process as plain HTTP
|
||||
std::cout << "HTTP REQUEST" << std::endl;
|
||||
|
||||
m_handler->http(type::shared_from_this());
|
||||
if (m_http_handler) {
|
||||
m_http_handler(m_connection_hdl);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -809,7 +811,7 @@ bool connection<config>::process_handshake_request() {
|
||||
}
|
||||
|
||||
// Ask application to validate the connection
|
||||
if (m_handler->validate(type::shared_from_this())) {
|
||||
if (!m_validate_handler || m_validate_handler(m_connection_hdl)) {
|
||||
m_response.set_status(http::status_code::SWITCHING_PROTOCOLS);
|
||||
|
||||
// Write the appropriate response headers based on request and
|
||||
|
||||
@@ -65,6 +65,8 @@ endpoint<connection,config>::create_connection() {
|
||||
con->set_pong_handler(m_pong_handler);
|
||||
con->set_pong_timeout_handler(m_pong_timeout_handler);
|
||||
con->set_interrupt_handler(m_interrupt_handler);
|
||||
con->set_http_handler(m_http_handler);
|
||||
con->set_validate_handler(m_validate_handler);
|
||||
|
||||
con->set_termination_handler(
|
||||
lib::bind(
|
||||
|
||||
Reference in New Issue
Block a user