mirror of
https://github.com/monero-project/monero.git
synced 2025-12-05 20:40:22 -08:00
Compare commits
2 Commits
911c6799dd
...
81f948a4a1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81f948a4a1 | ||
|
|
7e3edc29c6 |
@@ -92,7 +92,13 @@ namespace net_utils
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
static bool parse_port(const std::string& port_str, uint64_t& out_port)
|
||||
{
|
||||
out_port = 0;
|
||||
return boost::conversion::try_lexical_convert(port_str, out_port) && out_port <= 65535;
|
||||
}
|
||||
|
||||
bool parse_uri(const std::string uri, http::uri_content& content)
|
||||
{
|
||||
|
||||
@@ -153,7 +159,8 @@ namespace net_utils
|
||||
}
|
||||
if(result[6].matched)
|
||||
{
|
||||
content.port = boost::lexical_cast<uint64_t>(result[6]);
|
||||
if (!parse_port(result[6].str(), content.port))
|
||||
return false;
|
||||
}
|
||||
if(result[7].matched)
|
||||
{
|
||||
@@ -191,7 +198,8 @@ namespace net_utils
|
||||
}
|
||||
if(result[6].matched)
|
||||
{
|
||||
content.port = boost::lexical_cast<uint64_t>(result[6]);
|
||||
if (!parse_port(result[6].str(), content.port))
|
||||
return false;
|
||||
}
|
||||
if(result[7].matched)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user