Fixed port issue

This commit is contained in:
moss9001 2021-10-21 00:39:43 +03:00
parent ebb9ebb8c2
commit dc72582fb6
2 changed files with 8 additions and 8 deletions

View file

@ -7,6 +7,7 @@
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/case_conv.hpp>
//#include <iostream>
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

View file

@ -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;