GeezerVison is showing github.com — net, dns: socket should handle its output as input · nodejs/node@e6a47e8
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: lib/net.js +11-1Lines changed: 11 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -1110,6 +1110,16 @@ Socket.prototype.connect = function(...args) { |
1110 | 1110 | return this; |
1111 | 1111 | }; |
1112 | 1112 |
|
| 1113 | +function socketToDnsFamily(family) { |
| 1114 | + switch (family) { |
| 1115 | + case 'IPv4': |
| 1116 | + return 4; |
| 1117 | + case 'IPv6': |
| 1118 | + return 6; |
| 1119 | + } |
| 1120 | + |
| 1121 | + return family; |
| 1122 | +} |
1113 | 1123 |
|
1114 | 1124 | function lookupAndConnect(self, options) { |
1115 | 1125 | const { localAddress, localPort } = options; |
@@ -1152,7 +1162,7 @@ function lookupAndConnect(self, options) { |
1152 | 1162 |
|
1153 | 1163 | if (dns === undefined) dns = require('dns'); |
1154 | 1164 | const dnsopts = { |
1155 | | - family: options.family, |
| 1165 | + family: socketToDnsFamily(options.family), |
1156 | 1166 | hints: options.hints || 0 |
1157 | 1167 | }; |
1158 | 1168 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: test/parallel/parallel.status -10Lines changed: 0 additions & 10 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,10 +37,6 @@ test-crypto-dh-stateless: SKIP |
37 | 37 | test-crypto-keygen: SKIP |
38 | 38 |
|
39 | 39 | [$system==solaris] # Also applies to SmartOS |
40 | | -# https://github.com/nodejs/node/pull/43054 |
41 | | -test-net-socket-connect-without-cb: SKIP |
42 | | -test-net-socket-ready-without-cb: SKIP |
43 | | -test-tcp-wrap-listen: SKIP |
44 | 40 | # https://github.com/nodejs/node/issues/43446 |
45 | 41 | test-net-connect-reset-until-connected: PASS, FLAKY |
46 | 42 | # https://github.com/nodejs/node/issues/43457 |
@@ -65,12 +61,6 @@ test-worker-message-port-message-before-close: PASS,FLAKY |
65 | 61 | # https://github.com/nodejs/node/issues/43446 |
66 | 62 | test-net-connect-reset-until-connected: PASS, FLAKY |
67 | 63 |
|
68 | | -[$system==aix] |
69 | | -# https://github.com/nodejs/node/pull/43054 |
70 | | -test-net-socket-connect-without-cb: SKIP |
71 | | -test-net-socket-ready-without-cb: SKIP |
72 | | -test-tcp-wrap-listen: SKIP |
73 | | - |
74 | 64 | [$system==ibmi] |
75 | 65 | # https://github.com/nodejs/node/pull/30819 |
76 | 66 | test-child-process-fork-net-server: SKIP |
|