forked from firka/flutter
Remove _dartobservatory._tcp legacy DNS registration type (flutter/engine#51635)
As of https://github.com/flutter/flutter/pull/121606 the flutter tool no longer registers for the legacy `_dartobservatory._tcp` DNS type. Remove the fallback and just register for the preferred `_dartVmService._tcp`. See also https://github.com/dart-lang/sdk/issues/50233
This commit is contained in:
@@ -65,7 +65,6 @@
|
||||
|
||||
@implementation DartVMServiceDNSServiceDelegate {
|
||||
DNSServiceRef _dnsServiceRef;
|
||||
DNSServiceRef _legacyDnsServiceRef;
|
||||
}
|
||||
|
||||
- (void)stopService {
|
||||
@@ -73,10 +72,6 @@
|
||||
DNSServiceRefDeallocate(_dnsServiceRef);
|
||||
_dnsServiceRef = NULL;
|
||||
}
|
||||
if (_legacyDnsServiceRef) {
|
||||
DNSServiceRefDeallocate(_legacyDnsServiceRef);
|
||||
_legacyDnsServiceRef = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)publishServiceProtocolPort:(NSURL*)url {
|
||||
@@ -91,7 +86,6 @@
|
||||
uint32_t interfaceIndex = 0;
|
||||
#endif // TARGET_IPHONE_SIMULATOR
|
||||
const char* registrationType = "_dartVmService._tcp";
|
||||
const char* legacyRegistrationType = "_dartobservatory._tcp";
|
||||
|
||||
const char* domain = "local."; // default domain
|
||||
uint16_t port = [[url port] unsignedShortValue];
|
||||
@@ -107,20 +101,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO(bkonyi): remove once flutter_tools no longer looks for the legacy registration type.
|
||||
// See https://github.com/dart-lang/sdk/issues/50233
|
||||
//
|
||||
// Try to fallback on the legacy registration type.
|
||||
err = DNSServiceRegister(&_legacyDnsServiceRef, flags, interfaceIndex,
|
||||
FlutterDartVMServicePublisher.serviceName.UTF8String,
|
||||
legacyRegistrationType, domain, NULL, htons(port), txtData.length,
|
||||
txtData.bytes, RegistrationCallback, NULL);
|
||||
|
||||
if (err == 0) {
|
||||
DNSServiceSetDispatchQueue(_legacyDnsServiceRef, dispatch_get_main_queue());
|
||||
return;
|
||||
}
|
||||
|
||||
FML_LOG(ERROR) << "Failed to register Dart VM Service port with mDNS with error " << err << ".";
|
||||
if (@available(iOS 14.0, *)) {
|
||||
FML_LOG(ERROR) << "On iOS 14+, local network broadcast in apps need to be declared in "
|
||||
|
||||
Reference in New Issue
Block a user