mirror of
https://github.com/ceph/ceph
synced 2025-02-23 19:17:37 +00:00
msg/msg_types: add a default_type param to entity_addr_t::parse()
so it can be used in more places. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
7fb0569ec3
commit
b9e72ffe3a
@ -660,7 +660,7 @@ int MonMap::init_with_config_file(const ConfigProxy& conf,
|
||||
// there on a weird port is a v1 address, and do not handle
|
||||
// addrvecs.
|
||||
entity_addr_t addr;
|
||||
if (!addr.parse(val.c_str(), nullptr, entity_addr_t::TYPE_LEGACY)) {
|
||||
if (!addr.parse(val, entity_addr_t::TYPE_LEGACY)) {
|
||||
errout << "unable to parse address for mon." << mon_name
|
||||
<< ": addr='" << val << "'" << std::endl;
|
||||
continue;
|
||||
|
@ -96,11 +96,11 @@ void entity_inst_t::generate_test_instances(std::list<entity_inst_t*>& o)
|
||||
o.push_back(a);
|
||||
}
|
||||
|
||||
bool entity_addr_t::parse(const std::string_view s)
|
||||
bool entity_addr_t::parse(const std::string_view s, int default_type)
|
||||
{
|
||||
const char* start = s.data();
|
||||
const char* end = nullptr;
|
||||
bool got = parse(start, &end);
|
||||
bool got = parse(start, &end, default_type);
|
||||
return got && end == start + s.size();
|
||||
}
|
||||
|
||||
|
@ -407,7 +407,7 @@ struct entity_addr_t {
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
bool parse(const std::string_view s);
|
||||
bool parse(const std::string_view s, int default_type=TYPE_DEFAULT);
|
||||
bool parse(const char *s, const char **end = 0, int type=0);
|
||||
|
||||
void decode_legacy_addr_after_marker(ceph::buffer::list::const_iterator& bl)
|
||||
|
Loading…
Reference in New Issue
Block a user