Tested
IP of api.hive.blog = 51.79.10.214 Not work: hive-node-ip = 51.79.10.214 hive-node-rpc-port = 443 - bad request! Work: hive-node-ip = https://51.79.10.214 hive-node-rpc-port = 443 Work: hive-node-ip = https://api.hive.blog hive-node-rpc-port = 443 Work: hive-node-ip = 10.11.12.202 hive-node-rpc-port = 28090 Work: hive-node-ip = http://10.11.12.202 hive-node-rpc-port = 28090 Work: hive-node-ip = http://localhost hive-node-rpc-port = 28090 Work: hive-node-ip = localhost hive-node-rpc-port = 28090
This commit is contained in:
parent
2826f2e83f
commit
7ddad07df2
4 changed files with 6 additions and 5 deletions
|
|
@ -19,11 +19,10 @@ std::string resolveHostAddr(const std::string & hostName) {
|
||||||
|
|
||||||
std::string stripProtoName(const std::string & url) {
|
std::string stripProtoName(const std::string & url) {
|
||||||
auto index = url.find("://");
|
auto index = url.find("://");
|
||||||
if (index == url::npos)
|
if (index == std::string::npos)
|
||||||
return url;
|
return url;
|
||||||
return url.substr(index + 3);
|
return url.substr(index + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // net
|
} // net
|
||||||
} // peerplays
|
} // peerplays
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ namespace peerplays {
|
||||||
namespace net {
|
namespace net {
|
||||||
|
|
||||||
std::string resolveHostAddr(const std::string & hostName);
|
std::string resolveHostAddr(const std::string & hostName);
|
||||||
std::string stripProtoName(const std::string & utl);
|
std::string stripProtoName(const std::string & url);
|
||||||
|
|
||||||
|
|
||||||
} // net
|
} // net
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
#include <fc/log/logger.hpp>
|
#include <fc/log/logger.hpp>
|
||||||
#include <fc/network/ip.hpp>
|
#include <fc/network/ip.hpp>
|
||||||
|
|
||||||
|
#include <boost/algorithm/string/case_conv.hpp>
|
||||||
|
|
||||||
#include "https_call.h"
|
#include "https_call.h"
|
||||||
#include "net_utl.h"
|
#include "net_utl.h"
|
||||||
|
|
||||||
|
|
@ -152,7 +154,7 @@ fc::http::reply rpc_client::send_post_request(std::string body, bool show_log) {
|
||||||
addr = fc::ip::address(host);
|
addr = fc::ip::address(host);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
try {
|
try {
|
||||||
addr = fc::ip::address(peerplays::net::resolveHostIp(host));
|
addr = fc::ip::address(peerplays::net::resolveHostAddr(host));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
if (show_log) {
|
if (show_log) {
|
||||||
std::string url = ip + ":" + std::to_string(port);
|
std::string url = ip + ":" + std::to_string(port);
|
||||||
|
|
|
||||||
|
|
@ -156,7 +156,7 @@ sidechain_net_handler_hive::sidechain_net_handler_hive(peerplays_sidechain_plugi
|
||||||
addr = fc::ip::address(host);
|
addr = fc::ip::address(host);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
try {
|
try {
|
||||||
addr = fc::ip::address(peerplays::net::resolveHostIp(host));
|
addr = fc::ip::address(peerplays::net::resolveHostAddr(host));
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
elog("Failed to resolve Hive node address ${ip}", ("ip", node_ip));
|
elog("Failed to resolve Hive node address ${ip}", ("ip", node_ip));
|
||||||
FC_ASSERT(false);
|
FC_ASSERT(false);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue