From dc72582fb6b168dd3309711182e8fca1f4fbc726 Mon Sep 17 00:00:00 2001 From: moss9001 Date: Thu, 21 Oct 2021 00:39:43 +0300 Subject: [PATCH] Fixed port issue --- .../plugins/peerplays_sidechain/common/https_call.cpp | 10 ++++------ .../plugins/peerplays_sidechain/common/rpc_client.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/libraries/plugins/peerplays_sidechain/common/https_call.cpp b/libraries/plugins/peerplays_sidechain/common/https_call.cpp index 4d8be9c3..4e2b922a 100644 --- a/libraries/plugins/peerplays_sidechain/common/https_call.cpp +++ b/libraries/plugins/peerplays_sidechain/common/https_call.cpp @@ -7,6 +7,7 @@ #include #include +//#include namespace peerplays { namespace net { @@ -61,10 +62,6 @@ private: streambuf m_ResponseBuf; uint32_t m_ContentLength; - static uint16_t u16Swap(uint16_t x) { - return ((x >> 8) & 0x00FF) | ((x << 8) & 0xFF00); - } - void resolve() { // resolve TCP endpoint for host name @@ -75,7 +72,8 @@ private: m_Endpoint = *iter; if (m_Call.port() != 0) // if port was specified - m_Endpoint.port(u16Swap(m_Call.port())); // force set port + m_Endpoint.port(m_Call.port()); // force set port + } void connect() { @@ -101,7 +99,7 @@ private: // host - stream << "Host: " << m_Call.host() << ":" << u16Swap(m_Endpoint.port()) << CrLf; + stream << "Host: " << m_Call.host() << ":" << m_Endpoint.port() << CrLf; // content diff --git a/libraries/plugins/peerplays_sidechain/common/rpc_client.cpp b/libraries/plugins/peerplays_sidechain/common/rpc_client.cpp index 86a35844..34dda09b 100644 --- a/libraries/plugins/peerplays_sidechain/common/rpc_client.cpp +++ b/libraries/plugins/peerplays_sidechain/common/rpc_client.cpp @@ -120,11 +120,13 @@ fc::http::reply rpc_client::send_post_request(std::string body, bool show_log) { } if (show_log) { - std::string url = "http://" + ip + ":" + std::to_string(port); + std::string url = "https://" + ip + ":" + std::to_string(port); ilog("### Request URL: ${url}", ("url", url)); ilog("### Request: ${body}", ("body", body)); + ilog("### Response code: ${code}", ("code", response.statusCode)); + ilog("### Response len: ${len}", ("len", response.body.size())); std::stringstream ss(std::string(reply.body.begin(), reply.body.end())); - ilog("### Response: ${ss}", ("ss", ss.str())); + ilog("### Response body: ${ss}", ("ss", ss.str())); } return reply;