From a1c7f236bd0c8942c2e62bf4fdde13658797ee12 Mon Sep 17 00:00:00 2001 From: xiaoxin-mz <51474564+xiaoxin-mz@users.noreply.github.com> Date: Sat, 23 Mar 2024 22:48:18 +0800 Subject: [PATCH 1/2] Update uri.hpp std::string get_port_str() const { std::stringstream p; p << m_port; return p.str(); } if m_port == 9999, sometimes p.str() returns "9,999",i don't know why. but change to use std::to_string() is ok. --- websocketpp/uri.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/websocketpp/uri.hpp b/websocketpp/uri.hpp index c0b8b0cbd..d125c6634 100644 --- a/websocketpp/uri.hpp +++ b/websocketpp/uri.hpp @@ -245,9 +245,7 @@ class uri { if (m_port == (m_secure ? uri_default_secure_port : uri_default_port)) { return m_host; } else { - std::stringstream p; - p << m_host << ":" << m_port; - return p.str(); + return std::to_string(m_port); } } From c94f14457156d6da4fb2fed106017941632320d7 Mon Sep 17 00:00:00 2001 From: xiaoxin-mz <51474564+xiaoxin-mz@users.noreply.github.com> Date: Wed, 27 Mar 2024 20:30:51 +0800 Subject: [PATCH 2/2] Update uri.hpp it should be function get_port_str --- websocketpp/uri.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/websocketpp/uri.hpp b/websocketpp/uri.hpp index d125c6634..b5810bde1 100644 --- a/websocketpp/uri.hpp +++ b/websocketpp/uri.hpp @@ -245,7 +245,9 @@ class uri { if (m_port == (m_secure ? uri_default_secure_port : uri_default_port)) { return m_host; } else { - return std::to_string(m_port); + std::stringstream p; + p << m_host << ":" << m_port; + return p.str(); } } @@ -260,9 +262,7 @@ class uri { } std::string get_port_str() const { - std::stringstream p; - p << m_port; - return p.str(); + return std::to_string(m_port); } std::string const & get_resource() const {