mirror of
https://github.com/dawidd6/action-send-mail.git
synced 2026-10-09 18:04:08 +07:00
node_modules: update (#328)
Co-authored-by: dawidd6 <9713907+dawidd6@users.noreply.github.com>
This commit is contained in:
1 parent
23dc752083
commit
0e0ab085a3
10 files changed
+460
-192
No files matched your search
+30
-11
@@ -432,7 +432,7 @@ class Parser {
|
||||
}
|
||||
|
||||
onUpgrade (head) {
|
||||
const { upgrade, client, socket, headers, statusCode } = this
|
||||
const { upgrade, client, socket, headers, statusCode, statusText } = this
|
||||
|
||||
assert(upgrade)
|
||||
assert(client[kSocket] === socket)
|
||||
@@ -467,9 +467,10 @@ class Parser {
|
||||
client.emit('disconnect', client[kUrl], [client], new InformationalError('upgrade'))
|
||||
|
||||
try {
|
||||
request.onUpgrade(statusCode, headers, socket)
|
||||
} catch (err) {
|
||||
util.destroy(socket, err)
|
||||
request.onUpgrade(statusCode, headers, socket, statusText)
|
||||
} catch (error) {
|
||||
util.errorRequest(client, request, error)
|
||||
util.destroy(socket, error)
|
||||
}
|
||||
|
||||
client[kResume]()
|
||||
@@ -876,7 +877,7 @@ async function connectH1 (client, socket) {
|
||||
|
||||
function clearIdleSocketValidation (socket) {
|
||||
if (socket[kIdleSocketValidationTimeout]) {
|
||||
clearTimeout(socket[kIdleSocketValidationTimeout])
|
||||
clearImmediate(socket[kIdleSocketValidationTimeout])
|
||||
socket[kIdleSocketValidationTimeout] = null
|
||||
}
|
||||
|
||||
@@ -885,15 +886,23 @@ function clearIdleSocketValidation (socket) {
|
||||
|
||||
function scheduleIdleSocketValidation (client, socket) {
|
||||
socket[kIdleSocketValidation] = 1
|
||||
socket[kIdleSocketValidationTimeout] = setTimeout(() => {
|
||||
// Yield to the check phase (after poll) so unsolicited bytes / FIN / RST
|
||||
// already pending on this idle keep-alive socket are processed before the
|
||||
// next request is written (GHSA-35p6-xmwp-9g52).
|
||||
//
|
||||
// setTimeout(0) pays Node's ~1ms timer floor on every sequential reuse
|
||||
// (#5493). setImmediate avoids that, but an *unref'd* Immediate lets poll
|
||||
// block for ~500ms when the event loop is otherwise idle (#5600 / #5606).
|
||||
// A ref'd Immediate both keeps the pending request alive and makes poll
|
||||
// return immediately — the hybrid those issues asked for.
|
||||
socket[kIdleSocketValidationTimeout] = setImmediate(() => {
|
||||
socket[kIdleSocketValidationTimeout] = null
|
||||
socket[kIdleSocketValidation] = 2
|
||||
|
||||
if (client[kSocket] === socket && !socket.destroyed) {
|
||||
client[kResume]()
|
||||
}
|
||||
}, 0)
|
||||
socket[kIdleSocketValidationTimeout].unref?.()
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1042,12 +1051,22 @@ function writeH1 (client, request) {
|
||||
const socket = client[kSocket]
|
||||
clearIdleSocketValidation(socket)
|
||||
|
||||
const abort = (err) => {
|
||||
if (request.aborted || request.completed) {
|
||||
/**
|
||||
* @param {Error} [error]
|
||||
*/
|
||||
const abort = (error) => {
|
||||
if (request.aborted) {
|
||||
return
|
||||
}
|
||||
|
||||
util.errorRequest(client, request, err || new RequestAbortedError())
|
||||
if (request.completed) {
|
||||
if (request.upgrade || request.method === 'CONNECT') {
|
||||
util.destroy(socket, new InformationalError('aborted'))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
util.errorRequest(client, request, error || new RequestAbortedError())
|
||||
|
||||
util.destroy(body)
|
||||
util.destroy(socket, new InformationalError('aborted'))
|
||||
|
||||
Reference in new issue
Block a user