File tree Expand file tree Collapse file tree 1 file changed +1
-32
lines changed
Expand file tree Collapse file tree 1 file changed +1
-32
lines changed Original file line number Diff line number Diff line change @@ -453,38 +453,7 @@ void SubscriberConnection::StartConnection(const bool connectionAccepted)
453453 // Attempt to lookup remote connection identification for logging purposes
454454 const auto remoteEndPoint = m_commandChannelSocket.remote_endpoint ();
455455 m_ipAddress = remoteEndPoint.address ();
456-
457- if (remoteEndPoint.protocol () == tcp::v6 ())
458- m_connectionID = " [" + m_ipAddress.to_string () + " ]:" + ToString (remoteEndPoint.port ());
459- else
460- m_connectionID = m_ipAddress.to_string () + " :" + ToString (remoteEndPoint.port ());
461-
462- try
463- {
464- DnsResolver resolver (m_commandChannelService);
465- const DnsResolver::query dnsQuery (m_ipAddress.to_string (), ToString (remoteEndPoint.port ()));
466- DnsResolver::iterator iterator = resolver.resolve (dnsQuery);
467- const DnsResolver::iterator end;
468-
469- while (iterator != end)
470- {
471- const auto & endPoint = *iterator++;
472-
473- if (!endPoint.host_name ().empty ())
474- {
475- m_hostName = endPoint.host_name ();
476- m_connectionID = m_hostName + " (" + m_connectionID + " )" ;
477- break ;
478- }
479- }
480- }
481- catch (...)
482- { // -V565
483- // DNS lookup failure is not catastrophic
484- }
485-
486- if (m_hostName.empty ())
487- m_hostName = m_ipAddress.to_string ();
456+ m_connectionID = ResolveDNSName (m_commandChannelService, remoteEndPoint, m_hostName);
488457
489458 m_stopped = false ;
490459
You can’t perform that action at this time.
0 commit comments