diff options
author | Alexander Polcyn <apolcyn@google.com> | 2018-08-21 08:00:49 -0700 |
---|---|---|
committer | Alexander Polcyn <apolcyn@google.com> | 2018-09-11 13:17:24 -0700 |
commit | 964d679edc32b0f7316cacdb0652477d607f6de5 (patch) | |
tree | a3022c0aeb34310bb712ef6bf584b36a87d71b4b /src/core/ext/filters/client_channel/parse_address.cc | |
parent | c16eba8a4cb22b26e89d4f6aa34df74288c679f2 (diff) |
Resolve ip literals and Windows localhost manually when using c-ares
Diffstat (limited to 'src/core/ext/filters/client_channel/parse_address.cc')
-rw-r--r-- | src/core/ext/filters/client_channel/parse_address.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/ext/filters/client_channel/parse_address.cc b/src/core/ext/filters/client_channel/parse_address.cc index 7e726dd562..b94429e207 100644 --- a/src/core/ext/filters/client_channel/parse_address.cc +++ b/src/core/ext/filters/client_channel/parse_address.cc @@ -197,3 +197,12 @@ bool grpc_parse_uri(const grpc_uri* uri, grpc_resolved_address* resolved_addr) { gpr_log(GPR_ERROR, "Can't parse scheme '%s'", uri->scheme); return false; } + +uint16_t grpc_strhtons(const char* port) { + if (strcmp(port, "http") == 0) { + return htons(80); + } else if (strcmp(port, "https") == 0) { + return htons(443); + } + return htons(static_cast<unsigned short>(atoi(port))); +} |