@nxtedition/nxt-undici 6.4.0 → 6.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/interceptor/dns.js
CHANGED
|
@@ -104,27 +104,24 @@ export default () => (dispatch) => {
|
|
|
104
104
|
|
|
105
105
|
const hash = HASHER.h32(url.href)
|
|
106
106
|
|
|
107
|
-
for (let i = 0; i < records.length
|
|
107
|
+
for (let i = 0; i < records.length; i++) {
|
|
108
108
|
const idx = (hash + i) % records.length
|
|
109
109
|
if (records[idx].expires >= now && records[idx].timeout < now) {
|
|
110
110
|
record = records[idx]
|
|
111
|
+
break
|
|
111
112
|
}
|
|
112
113
|
}
|
|
114
|
+
}
|
|
113
115
|
|
|
114
|
-
|
|
115
|
-
const idx = (hash + i) % records.length
|
|
116
|
-
if (records[idx].expires >= now) {
|
|
117
|
-
record = records[idx]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
} else {
|
|
116
|
+
if (record == null) {
|
|
121
117
|
records.sort(
|
|
122
118
|
(a, b) => a.errored - b.errored || a.pending - b.pending || a.counter - b.counter,
|
|
123
119
|
)
|
|
124
120
|
|
|
125
|
-
for (let i = 0; i < records.length
|
|
121
|
+
for (let i = 0; i < records.length; i++) {
|
|
126
122
|
if (records[i].expires >= now) {
|
|
127
123
|
record = records[i]
|
|
124
|
+
break
|
|
128
125
|
}
|
|
129
126
|
}
|
|
130
127
|
}
|