Skip to content

Commit 55a4ee8

Browse files
tamirdcommit-bot@chromium.org
authored andcommitted
[vm] correctly create connection errors
When sourceAddress is null, there is no bind call, so the error cannot possibly be a bind failure. Change-Id: Idec2aff48c436b89f9b571458d0fbce700793d33 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/110184 Commit-Queue: Zach Anderson <[email protected]> Reviewed-by: Zach Anderson <[email protected]> Auto-Submit: Tamir Duberstein <[email protected]>
1 parent e0ee7cb commit 55a4ee8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

runtime/bin/socket_patch.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,9 @@ class _NativeSocket extends _NativeSocketNativeWrapper with _ServiceObject {
475475
// Keep first error, if present.
476476
if (error == null) {
477477
int errorCode = result.errorCode;
478-
if (errorCode != null && socket.isBindError(errorCode)) {
478+
if (sourceAddress != null &&
479+
errorCode != null &&
480+
socket.isBindError(errorCode)) {
479481
error = createError(result, "Bind failed", sourceAddress);
480482
} else {
481483
error = createError(result, "Connection failed", address, port);

0 commit comments

Comments
 (0)