You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2021/05/04 15:37:02 UTC

[GitHub] [trafficserver] bneradt commented on a change in pull request #7778: DNS: Clean up argument passing to DNS queries.

bneradt commented on a change in pull request #7778:
URL: https://github.com/apache/trafficserver/pull/7778#discussion_r625886818



##########
File path: iocore/dns/I_DNSProcessor.h
##########
@@ -151,25 +167,31 @@ extern DNSProcessor dnsProcessor;
 inline Action *
 DNSProcessor::getSRVbyname(Continuation *cont, const char *name, Options const &opt)
 {
-  return getby(name, 0, T_SRV, cont, opt);
+  return getby(std::string_view(name), T_SRV, cont, opt);
+}
+
+inline Action *
+DNSProcessor::getSRVbyname(Continuation *cont, std::string_view name, Options const &opt)
+{
+  return getby(name, T_SRV, cont, opt);
 }
 
 inline Action *
 DNSProcessor::gethostbyname(Continuation *cont, const char *name, Options const &opt)
 {
-  return getby(name, 0, T_A, cont, opt);
+  return getby(std::string_view(name), T_A, cont, opt);
 }
 
 inline Action *
-DNSProcessor::gethostbyname(Continuation *cont, const char *name, int len, Options const &opt)
+DNSProcessor::gethostbyname(Continuation *cont, std::string_view name, Options const &opt)
 {
-  return getby(name, len, T_A, cont, opt);
+  return getby(name, T_A, cont, opt);
 }
 
 inline Action *
 DNSProcessor::gethostbyaddr(Continuation *cont, IpAddr const *addr, Options const &opt)
 {
-  return getby(reinterpret_cast<const char *>(addr), 0, T_PTR, cont, opt);
+  return getby(*addr, T_PTR, cont, opt);
 }

Review comment:
       `addr` is dereferenced without checking for nullptr. Should addr be taken as a const reference?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org