Add error on DNS parsing failure, fix proxy DNS name

This commit is contained in:
Michael Lumish 2020-04-14 11:32:07 -07:00
parent cba41bc487
commit e73c96298f
2 changed files with 10 additions and 2 deletions

View File

@ -145,7 +145,7 @@ export function mapProxyName(
extraOptions['grpc.http_connect_creds'] = proxyInfo.creds;
}
return {
target: `dns:///${proxyInfo.address}`,
target: `dns:${proxyInfo.address}`,
extraOptions: extraOptions,
};
}

View File

@ -171,7 +171,15 @@ class DnsResolver implements Resolver {
});
return;
}
if (this.dnsHostname !== null) {
if (this.dnsHostname === null) {
setImmediate(() => {
this.listener.onError({
code: Status.UNAVAILABLE,
details: `Failed to parse DNS address ${this.target}`,
metadata: new Metadata(),
});
});
} else {
/* We clear out latestLookupResult here to ensure that it contains the
* latest result since the last time we started resolving. That way, the
* TXT resolution handler can use it, but only if it finishes second. We