From 7afcd866a0bfd289ae6d23c900132a81023d5314 Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Sat, 30 Mar 2013 07:05:08 -0500 Subject: [PATCH] adds the ability to set a connection URI outside of the server handshake --- websocketpp/connection.hpp | 9 +++++++++ websocketpp/impl/connection_impl.hpp | 6 ++++++ 2 files changed, 15 insertions(+) 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; +} +