diff options
author | Pieter Wuille <pieter.wuille@gmail.com> | 2016-12-27 10:11:21 -0800 |
---|---|---|
committer | Pieter Wuille <pieter.wuille@gmail.com> | 2016-12-27 10:17:11 -0800 |
commit | 7aa700424cbda387536373d8dfec88aee43f950e (patch) | |
tree | 866140c4737995ac77ac7ccefcb78f8b3cc2e353 /src/httpserver.cpp | |
parent | dbc8a8c86ae50059fddb2d6834fa5f0c9bbf9b71 (diff) | |
parent | c2f61bebb190258753714b29ab2041e80651cec9 (diff) |
Merge #9243: Clean up mapArgs and mapMultiArgs Usage
c2f61be Add a ForceSetArg method for testing (Matt Corallo)
4e04814 Lock mapArgs/mapMultiArgs access in util (Matt Corallo)
4cd373a Un-expose mapArgs from utils.h (Matt Corallo)
71fde55 Get rid of mapArgs direct access in ZMQ construction (Matt Corallo)
0cf86a6 Introduce (and use) an IsArgSet accessor method (Matt Corallo)
2b5f085 Fix non-const mapMultiArgs[] access after init. (Matt Corallo)
c8042a4 Remove arguments to ParseConfigFile (Matt Corallo)
Diffstat (limited to 'src/httpserver.cpp')
-rw-r--r-- | src/httpserver.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp index b296b28503..2573900746 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -204,7 +204,7 @@ static bool InitHTTPAllowList() rpc_allow_subnets.push_back(CSubNet(localv4, 8)); // always allow IPv4 local subnet rpc_allow_subnets.push_back(CSubNet(localv6)); // always allow IPv6 localhost if (mapMultiArgs.count("-rpcallowip")) { - const std::vector<std::string>& vAllow = mapMultiArgs["-rpcallowip"]; + const std::vector<std::string>& vAllow = mapMultiArgs.at("-rpcallowip"); for (std::string strAllow : vAllow) { CSubNet subnet; LookupSubNet(strAllow.c_str(), subnet); @@ -322,14 +322,14 @@ static bool HTTPBindAddresses(struct evhttp* http) std::vector<std::pair<std::string, uint16_t> > endpoints; // Determine what addresses to bind to - if (!mapArgs.count("-rpcallowip")) { // Default to loopback if not allowing external IPs + if (!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)); - if (mapArgs.count("-rpcbind")) { + if (IsArgSet("-rpcbind")) { LogPrintf("WARNING: option -rpcbind was ignored because -rpcallowip was not specified, refusing to allow everyone to connect\n"); } - } else if (mapArgs.count("-rpcbind")) { // Specific bind address - const std::vector<std::string>& vbind = mapMultiArgs["-rpcbind"]; + } else if (mapMultiArgs.count("-rpcbind")) { // Specific bind address + const std::vector<std::string>& vbind = mapMultiArgs.at("-rpcbind"); for (std::vector<std::string>::const_iterator i = vbind.begin(); i != vbind.end(); ++i) { int port = defaultPort; std::string host; |