diff --git a/websocketpp/connection.hpp b/websocketpp/connection.hpp index 480773894e..b5f4325bae 100644 --- a/websocketpp/connection.hpp +++ b/websocketpp/connection.hpp @@ -497,6 +497,15 @@ public: * @return The port component of the connection URI */ uint16_t get_port() const; + + /// Sets the connection URI + /** + * This should really only be called by internal library methods unless you + * really know what you are doing. + * + * @param uri The new URI to set + */ + void set_uri(uri_ptr uri); ///////////////////////////////////////////////////////////// // Pass-through access to the request and response objects // diff --git a/websocketpp/impl/connection_impl.hpp b/websocketpp/impl/connection_impl.hpp index 4c2be7c046..8e5d63b86e 100644 --- a/websocketpp/impl/connection_impl.hpp +++ b/websocketpp/impl/connection_impl.hpp @@ -299,6 +299,12 @@ uint16_t connection::get_port() const { return m_uri->get_port(); } +template +void connection::set_uri(uri_ptr uri) { + //scoped_lock_type lock(m_connection_state_lock); + m_uri = uri; +} +