This is an automated email from the ASF dual-hosted git repository.

bneradt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 3b2e216dde Remove unused getbyxxx methods from DNSProcessor (#10656)
3b2e216dde is described below

commit 3b2e216dde7e01a43e055e5ab7f7dd178482f06b
Author: JosiahWI <[email protected]>
AuthorDate: Thu Oct 26 10:28:11 2023 -0500

    Remove unused getbyxxx methods from DNSProcessor (#10656)
    
    These old methods that used const char* are superceded by the ones that
    use std::string_view.
---
 include/iocore/dns/DNSProcessor.h | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/include/iocore/dns/DNSProcessor.h 
b/include/iocore/dns/DNSProcessor.h
index 5f455dda40..c860cc3575 100644
--- a/include/iocore/dns/DNSProcessor.h
+++ b/include/iocore/dns/DNSProcessor.h
@@ -121,10 +121,11 @@ struct DNSProcessor : public Processor {
   // NOTE: the HostEnt *block is freed when the function returns
   //
 
-  Action *gethostbyname(Continuation *cont, const char *name, Options const 
&opt);
+  // To avoid lifetime issues, the name will be copied out of the view's
+  // buffer before the query is scheduled.
   Action *gethostbyname(Continuation *cont, std::string_view name, Options 
const &opt);
-  Action *getSRVbyname(Continuation *cont, const char *name, Options const 
&opt);
   Action *getSRVbyname(Continuation *cont, std::string_view name, Options 
const &opt);
+
   Action *gethostbyaddr(Continuation *cont, IpAddr const *ip, Options const 
&opt);
 
   // Processor API
@@ -168,24 +169,12 @@ extern DNSProcessor dnsProcessor;
 // Inline Functions
 //
 
-inline Action *
-DNSProcessor::getSRVbyname(Continuation *cont, const char *name, Options const 
&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(std::string_view(name), T_A, cont, opt);
-}
-
 inline Action *
 DNSProcessor::gethostbyname(Continuation *cont, std::string_view name, Options 
const &opt)
 {

Reply via email to