Skip to content

Commit cec29f1

Browse files
derekxu16Commit Queue
authored andcommitted
Revert "[DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address"
This reverts commit 4391ca6. Reason for revert: breaks internal tests Original change's description: > [DDS] Make runDartDevelopmentServiceFromCLI use IPv6 to serve DDS if either the VM Service address or the bind address cannot be resolved to an IPv4 address > > TEST=CI > > Fixes: #56557 > Change-Id: Id06532aedf26d8d5e4d037df72dece2d6550e694 > Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389521 > Reviewed-by: Ben Konyi <[email protected]> > Commit-Queue: Derek Xu <[email protected]> Change-Id: I02709235d32abab122b5269a5d80f12c4085988b Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/390542 Bot-Commit: Rubber Stamper <[email protected]> Commit-Queue: Derek Xu <[email protected]> Reviewed-by: Siva Annamalai <[email protected]>
1 parent 8b1fab0 commit cec29f1

File tree

2 files changed

+10
-23
lines changed

2 files changed

+10
-23
lines changed

pkg/dds/lib/src/dds_cli_entrypoint.dart

Lines changed: 6 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,18 @@ ${argParser.usage}
4949
return;
5050
}
5151

52-
// Check if the remote VM Service address can be resolved to an IPv4 address.
52+
// This URI is provided by the VM service directly so don't bother doing a
53+
// lookup.
5354
final remoteVmServiceUri = Uri.parse(
5455
argResults[DartDevelopmentServiceOptions.vmServiceUriOption],
5556
);
56-
bool doesVmServiceAddressResolveToIpv4Address = false;
57-
try {
58-
final addresses = await InternetAddress.lookup(remoteVmServiceUri.host);
59-
for (final address in addresses) {
60-
if (address.type == InternetAddressType.IPv4) {
61-
doesVmServiceAddressResolveToIpv4Address = true;
62-
}
63-
}
64-
} on SocketException catch (e, st) {
65-
writeErrorResponse(
66-
'Invalid --${DartDevelopmentServiceOptions.vmServiceUriOption} argument: '
67-
'$remoteVmServiceUri',
68-
st,
69-
);
70-
return;
71-
}
7257

7358
// Ensure that the bind address, which is potentially provided by the user,
7459
// can be resolved at all, and check whether it can be resolved to an IPv4
7560
// address.
61+
bool doesBindAddressResolveToIpv4Address = false;
7662
final bindAddress =
7763
argResults[DartDevelopmentServiceOptions.bindAddressOption];
78-
bool doesBindAddressResolveToIpv4Address = false;
7964
try {
8065
final addresses = await InternetAddress.lookup(bindAddress);
8166
for (final address in addresses) {
@@ -130,10 +115,9 @@ ${argParser.usage}
130115
remoteVmServiceUri,
131116
serviceUri: serviceUri,
132117
enableAuthCodes: !disableServiceAuthCodes,
133-
// Only use IPv6 to serve DDS if either the remote VM Service address or
134-
// the bind address cannot be resolved to an IPv4 address.
135-
ipv6: !doesVmServiceAddressResolveToIpv4Address ||
136-
!doesBindAddressResolveToIpv4Address,
118+
// Only use IPv6 to serve DDS if the bind address cannot be resolved to an
119+
// IPv4 address.
120+
ipv6: !doesBindAddressResolveToIpv4Address,
137121
devToolsConfiguration: serveDevTools && devToolsBuildDirectory != null
138122
? DevToolsConfiguration(
139123
enable: serveDevTools,

pkg/dds/test/dap/integration/debug_attach_test.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ main() {
128128

129129
expect(
130130
outputEvents.map((e) => e.output).join(),
131-
contains('Invalid --vm-service-uri argument: http://bogus.local'),
131+
allOf(
132+
contains('Failed to start DDS for ws://bogus.local/'),
133+
contains('Failed host lookup'),
134+
),
132135
);
133136
});
134137

0 commit comments

Comments
 (0)