scripted-diff: Rename misleading 'defaultPort' to 'http_port'

-BEGIN VERIFY SCRIPT-
sed -i -e 's/\<defaultPort\>/http_port/g' src/httpserver.cpp
-END VERIFY SCRIPT-
This commit is contained in:
Murray Nesbitt 2018-11-01 02:19:55 -07:00
parent b312579c69
commit 4ed730802f

View file

@ -292,26 +292,26 @@ static bool ThreadHTTP(struct event_base* base)
/** Bind HTTP server to specified addresses */
static bool HTTPBindAddresses(struct evhttp* http)
{
int defaultPort = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
int http_port = gArgs.GetArg("-rpcport", BaseParams().RPCPort());
std::vector<std::pair<std::string, uint16_t> > endpoints;
// Determine what addresses to bind to
if (!gArgs.IsArgSet("-rpcallowip")) { // Default to loopback if not allowing external IPs
endpoints.push_back(std::make_pair("::1", defaultPort));
endpoints.push_back(std::make_pair("127.0.0.1", defaultPort));
endpoints.push_back(std::make_pair("::1", http_port));
endpoints.push_back(std::make_pair("127.0.0.1", http_port));
if (gArgs.IsArgSet("-rpcbind")) {
LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n");
}
} else if (gArgs.IsArgSet("-rpcbind")) { // Specific bind address
for (const std::string& strRPCBind : gArgs.GetArgs("-rpcbind")) {
int port = defaultPort;
int port = http_port;
std::string host;
SplitHostPort(strRPCBind, port, host);
endpoints.push_back(std::make_pair(host, port));
}
} else { // No specific bind address specified, bind to any
endpoints.push_back(std::make_pair("::", defaultPort));
endpoints.push_back(std::make_pair("0.0.0.0", defaultPort));
endpoints.push_back(std::make_pair("::", http_port));
endpoints.push_back(std::make_pair("0.0.0.0", http_port));
}
// Bind addresses