| 890 | } |
| 891 | |
| 892 | bool parse_optional_port(const ConfigPair& sample, NetworkAddress& retval, const NetworkAddress& value) |
| 893 | { |
| 894 | ACE_INET_Addr addr; |
| 895 | if (addr.set(sample.value().c_str()) == 0) { |
| 896 | retval = NetworkAddress(addr); |
| 897 | return true; |
| 898 | } else if (addr.set(u_short(0), sample.value().c_str()) == 0) { |
| 899 | retval = NetworkAddress(addr); |
| 900 | return true; |
| 901 | } else { |
| 902 | retval = value; |
| 903 | if (log_level >= LogLevel::Warning) { |
| 904 | ACE_ERROR((LM_WARNING, |
| 905 | ACE_TEXT("(%P|%t) WARNING: ConfigStoreImpl::get: ") |
| 906 | ACE_TEXT("failed to parse NetworkAddress for %C=%C\n"), |
| 907 | sample.key().c_str(), sample.value().c_str())); |
| 908 | } |
| 909 | } |
| 910 | return false; |
| 911 | } |
| 912 | } |
| 913 | |
| 914 | NetworkAddress |