mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Adds storage and getter for negotiated subprotocol
This commit is contained in:
@@ -519,7 +519,20 @@ public:
|
||||
* @param uri The new URI to set
|
||||
*/
|
||||
void set_uri(uri_ptr uri);
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
// Subprotocol negotiation //
|
||||
/////////////////////////////
|
||||
|
||||
/// Gets the negotated subprotocol
|
||||
/**
|
||||
* Retrieves the subprotocol that was negotiated during the handshake. This
|
||||
* method is valid in the open handler and later.
|
||||
*
|
||||
* @return The negotiated subprotocol
|
||||
*/
|
||||
const std::string& get_subprotocol() const;
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
// Pass-through access to the request and response objects //
|
||||
/////////////////////////////////////////////////////////////
|
||||
@@ -952,6 +965,7 @@ private:
|
||||
request_type m_request;
|
||||
response_type m_response;
|
||||
uri_ptr m_uri;
|
||||
std::string m_subprotocol;
|
||||
|
||||
const bool m_is_server;
|
||||
alog_type& m_alog;
|
||||
|
||||
@@ -316,7 +316,10 @@ void connection<config>::set_uri(uri_ptr uri) {
|
||||
|
||||
|
||||
|
||||
|
||||
template <typename config>
|
||||
const std::string & connection<config>::get_subprotocol() const {
|
||||
return m_subprotocol;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user